Class: IntersightClient::StoragePhysicalDisk
- Inherits:
-
EquipmentBase
- Object
- MoBaseMo
- InventoryBase
- EquipmentBase
- IntersightClient::StoragePhysicalDisk
- Defined in:
- lib/intersight_client/models/storage_physical_disk.rb
Overview
Physical Disk on a server.
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#block_size ⇒ Object
The block size of the physical disk in bytes.
-
#bootable ⇒ Object
This field identifies the disk drive as bootable if set to true.
-
#class_id ⇒ Object
The fully-qualified name of the instantiated, concrete type.
-
#configuration_checkpoint ⇒ Object
The current configuration checkpoint of the physical disk.
-
#configuration_state ⇒ Object
The current configuration state of the physical disk.
-
#discovered_path ⇒ Object
The discovered path of the physical disk.
-
#disk_id ⇒ Object
This field identifies the ID assigned to physical disks.
-
#disk_state ⇒ Object
This field identifies the health of the disk.
-
#drive_firmware ⇒ Object
This field identifies the disk firmware running in the disk.
-
#drive_state ⇒ Object
The drive state as reported by the controller.
-
#fde_capable ⇒ Object
Full-Disk Encryption capability parameter of the physical disk.
-
#hot_spare_type ⇒ Object
Type of hotspare configured on the physical disk.
-
#inventory_device_info ⇒ Object
Returns the value of attribute inventory_device_info.
-
#link_speed ⇒ Object
The speed of the link between the drive and the controller.
-
#link_state ⇒ Object
The current link state of the physical disk.
-
#locator_led ⇒ Object
Returns the value of attribute locator_led.
-
#num_blocks ⇒ Object
The number of blocks present on the physical disk.
-
#object_type ⇒ Object
The fully-qualified name of the instantiated, concrete type.
-
#oper_power_state ⇒ Object
Operational power of the physical disk.
-
#oper_qualifier_reason ⇒ Object
For certain states, indicates the reason why the operState is in that state.
-
#operability ⇒ Object
This field identifies the disk operability of the disk.
-
#physical_block_size ⇒ Object
The block size of the installed physical disk.
-
#physical_disk_extensions ⇒ Object
An array of relationships to storagePhysicalDiskExtension resources.
-
#pid ⇒ Object
This field identifies the Product ID for physicalDisk.
-
#protocol ⇒ Object
This field identifies the disk protocol used for communication.
-
#raw_size ⇒ Object
The raw size of the physical disk in MB.
-
#registered_device ⇒ Object
Returns the value of attribute registered_device.
-
#running_firmware ⇒ Object
An array of relationships to firmwareRunningFirmware resources.
-
#sas_ports ⇒ Object
An array of relationships to storageSasPort resources.
-
#secured ⇒ Object
This field identifies whether the disk is encrypted.
-
#size ⇒ Object
The size of the physical disk in MB.
-
#storage_controller ⇒ Object
Returns the value of attribute storage_controller.
-
#storage_enclosure ⇒ Object
Returns the value of attribute storage_enclosure.
-
#thermal ⇒ Object
Thermal state of the physical disk.
-
#type ⇒ Object
This field identifies the type of the physical disk.
-
#variant_type ⇒ Object
The variant type of the physical disk.
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 = {}) ⇒ StoragePhysicalDisk
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 = {}) ⇒ StoragePhysicalDisk
Initializes the object
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 393 394 395 396 397 398 399 400 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 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 262 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `IntersightClient::StoragePhysicalDisk` 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 = 'storage.PhysicalDisk' end if attributes.key?(:'object_type') self.object_type = attributes[:'object_type'] else self.object_type = 'storage.PhysicalDisk' end if attributes.key?(:'block_size') self.block_size = attributes[:'block_size'] end if attributes.key?(:'bootable') self.bootable = attributes[:'bootable'] end if attributes.key?(:'configuration_checkpoint') self.configuration_checkpoint = attributes[:'configuration_checkpoint'] end if attributes.key?(:'configuration_state') self.configuration_state = attributes[:'configuration_state'] end if attributes.key?(:'discovered_path') self.discovered_path = attributes[:'discovered_path'] end if attributes.key?(:'disk_id') self.disk_id = attributes[:'disk_id'] end if attributes.key?(:'disk_state') self.disk_state = attributes[:'disk_state'] end if attributes.key?(:'drive_firmware') self.drive_firmware = attributes[:'drive_firmware'] end if attributes.key?(:'drive_state') self.drive_state = attributes[:'drive_state'] end if attributes.key?(:'fde_capable') self.fde_capable = attributes[:'fde_capable'] end if attributes.key?(:'hot_spare_type') self.hot_spare_type = attributes[:'hot_spare_type'] end if attributes.key?(:'link_speed') self.link_speed = attributes[:'link_speed'] end if attributes.key?(:'link_state') self.link_state = attributes[:'link_state'] end if attributes.key?(:'num_blocks') self.num_blocks = attributes[:'num_blocks'] end if attributes.key?(:'oper_power_state') self.oper_power_state = attributes[:'oper_power_state'] end if attributes.key?(:'oper_qualifier_reason') self.oper_qualifier_reason = attributes[:'oper_qualifier_reason'] end if attributes.key?(:'operability') self.operability = attributes[:'operability'] end if attributes.key?(:'physical_block_size') self.physical_block_size = attributes[:'physical_block_size'] end if attributes.key?(:'pid') self.pid = attributes[:'pid'] end if attributes.key?(:'protocol') self.protocol = attributes[:'protocol'] end if attributes.key?(:'raw_size') self.raw_size = attributes[:'raw_size'] end if attributes.key?(:'secured') self.secured = attributes[:'secured'] end if attributes.key?(:'size') self.size = attributes[:'size'] end if attributes.key?(:'thermal') self.thermal = attributes[:'thermal'] end if attributes.key?(:'type') self.type = attributes[:'type'] end if attributes.key?(:'variant_type') self.variant_type = attributes[:'variant_type'] 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?(:'physical_disk_extensions') if (value = attributes[:'physical_disk_extensions']).is_a?(Array) self.physical_disk_extensions = value end end if attributes.key?(:'registered_device') self.registered_device = attributes[:'registered_device'] end if attributes.key?(:'running_firmware') if (value = attributes[:'running_firmware']).is_a?(Array) self.running_firmware = value end end if attributes.key?(:'sas_ports') if (value = attributes[:'sas_ports']).is_a?(Array) self.sas_ports = value end end if attributes.key?(:'storage_controller') self.storage_controller = attributes[:'storage_controller'] end if attributes.key?(:'storage_enclosure') self.storage_enclosure = attributes[:'storage_enclosure'] end end |
Instance Attribute Details
#block_size ⇒ Object
The block size of the physical disk in bytes.
26 27 28 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 26 def block_size @block_size end |
#bootable ⇒ Object
This field identifies the disk drive as bootable if set to true.
29 30 31 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 29 def bootable @bootable 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/storage_physical_disk.rb', line 20 def class_id @class_id end |
#configuration_checkpoint ⇒ Object
The current configuration checkpoint of the physical disk.
32 33 34 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 32 def configuration_checkpoint @configuration_checkpoint end |
#configuration_state ⇒ Object
The current configuration state of the physical disk.
35 36 37 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 35 def configuration_state @configuration_state end |
#discovered_path ⇒ Object
The discovered path of the physical disk.
38 39 40 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 38 def discovered_path @discovered_path end |
#disk_id ⇒ Object
This field identifies the ID assigned to physical disks.
41 42 43 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 41 def disk_id @disk_id end |
#disk_state ⇒ Object
This field identifies the health of the disk.
44 45 46 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 44 def disk_state @disk_state end |
#drive_firmware ⇒ Object
This field identifies the disk firmware running in the disk.
47 48 49 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 47 def drive_firmware @drive_firmware end |
#drive_state ⇒ Object
The drive state as reported by the controller.
50 51 52 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 50 def drive_state @drive_state end |
#fde_capable ⇒ Object
Full-Disk Encryption capability parameter of the physical disk.
53 54 55 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 53 def fde_capable @fde_capable end |
#hot_spare_type ⇒ Object
Type of hotspare configured on the physical disk.
56 57 58 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 56 def hot_spare_type @hot_spare_type end |
#inventory_device_info ⇒ Object
Returns the value of attribute inventory_device_info.
103 104 105 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 103 def inventory_device_info @inventory_device_info end |
#link_speed ⇒ Object
The speed of the link between the drive and the controller.
59 60 61 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 59 def link_speed @link_speed end |
#link_state ⇒ Object
The current link state of the physical disk.
62 63 64 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 62 def link_state @link_state end |
#locator_led ⇒ Object
Returns the value of attribute locator_led.
105 106 107 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 105 def locator_led @locator_led end |
#num_blocks ⇒ Object
The number of blocks present on the physical disk.
65 66 67 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 65 def num_blocks @num_blocks 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/storage_physical_disk.rb', line 23 def object_type @object_type end |
#oper_power_state ⇒ Object
Operational power of the physical disk.
68 69 70 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 68 def oper_power_state @oper_power_state end |
#oper_qualifier_reason ⇒ Object
For certain states, indicates the reason why the operState is in that state.
71 72 73 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 71 def oper_qualifier_reason @oper_qualifier_reason end |
#operability ⇒ Object
This field identifies the disk operability of the disk.
74 75 76 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 74 def operability @operability end |
#physical_block_size ⇒ Object
The block size of the installed physical disk.
77 78 79 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 77 def physical_block_size @physical_block_size end |
#physical_disk_extensions ⇒ Object
An array of relationships to storagePhysicalDiskExtension resources.
108 109 110 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 108 def physical_disk_extensions @physical_disk_extensions end |
#pid ⇒ Object
This field identifies the Product ID for physicalDisk.
80 81 82 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 80 def pid @pid end |
#protocol ⇒ Object
This field identifies the disk protocol used for communication.
83 84 85 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 83 def protocol @protocol end |
#raw_size ⇒ Object
The raw size of the physical disk in MB.
86 87 88 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 86 def raw_size @raw_size end |
#registered_device ⇒ Object
Returns the value of attribute registered_device.
110 111 112 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 110 def registered_device @registered_device end |
#running_firmware ⇒ Object
An array of relationships to firmwareRunningFirmware resources.
113 114 115 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 113 def running_firmware @running_firmware end |
#sas_ports ⇒ Object
An array of relationships to storageSasPort resources.
116 117 118 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 116 def sas_ports @sas_ports end |
#secured ⇒ Object
This field identifies whether the disk is encrypted.
89 90 91 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 89 def secured @secured end |
#size ⇒ Object
The size of the physical disk in MB.
92 93 94 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 92 def size @size end |
#storage_controller ⇒ Object
Returns the value of attribute storage_controller.
118 119 120 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 118 def storage_controller @storage_controller end |
#storage_enclosure ⇒ Object
Returns the value of attribute storage_enclosure.
120 121 122 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 120 def storage_enclosure @storage_enclosure end |
#thermal ⇒ Object
Thermal state of the physical disk.
95 96 97 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 95 def thermal @thermal end |
#type ⇒ Object
This field identifies the type of the physical disk.
98 99 100 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 98 def type @type end |
#variant_type ⇒ Object
The variant type of the physical disk.
101 102 103 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 101 def variant_type @variant_type 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)
192 193 194 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 192 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)
187 188 189 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 187 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.
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 172 173 174 175 176 177 178 179 180 181 182 183 184 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 145 def self.attribute_map { :'class_id' => :'ClassId', :'object_type' => :'ObjectType', :'block_size' => :'BlockSize', :'bootable' => :'Bootable', :'configuration_checkpoint' => :'ConfigurationCheckpoint', :'configuration_state' => :'ConfigurationState', :'discovered_path' => :'DiscoveredPath', :'disk_id' => :'DiskId', :'disk_state' => :'DiskState', :'drive_firmware' => :'DriveFirmware', :'drive_state' => :'DriveState', :'fde_capable' => :'FdeCapable', :'hot_spare_type' => :'HotSpareType', :'link_speed' => :'LinkSpeed', :'link_state' => :'LinkState', :'num_blocks' => :'NumBlocks', :'oper_power_state' => :'OperPowerState', :'oper_qualifier_reason' => :'OperQualifierReason', :'operability' => :'Operability', :'physical_block_size' => :'PhysicalBlockSize', :'pid' => :'Pid', :'protocol' => :'Protocol', :'raw_size' => :'RawSize', :'secured' => :'Secured', :'size' => :'Size', :'thermal' => :'Thermal', :'type' => :'Type', :'variant_type' => :'VariantType', :'inventory_device_info' => :'InventoryDeviceInfo', :'locator_led' => :'LocatorLed', :'physical_disk_extensions' => :'PhysicalDiskExtensions', :'registered_device' => :'RegisteredDevice', :'running_firmware' => :'RunningFirmware', :'sas_ports' => :'SasPorts', :'storage_controller' => :'StorageController', :'storage_enclosure' => :'StorageEnclosure' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
538 539 540 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 538 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_all_of ⇒ Object
List of class defined in allOf (OpenAPI v3)
248 249 250 251 252 253 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 248 def self.openapi_all_of [ :'EquipmentBase', :'StoragePhysicalDiskAllOf' ] end |
.openapi_discriminator_name ⇒ Object
discriminator’s property name in OpenAPI v3
256 257 258 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 256 def self.openapi_discriminator_name :'ClassId' end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
239 240 241 242 243 244 245 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 239 def self.openapi_nullable Set.new([ :'physical_disk_extensions', :'running_firmware', :'sas_ports', ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 197 def self.openapi_types { :'class_id' => :'String', :'object_type' => :'String', :'block_size' => :'String', :'bootable' => :'String', :'configuration_checkpoint' => :'String', :'configuration_state' => :'String', :'discovered_path' => :'String', :'disk_id' => :'String', :'disk_state' => :'String', :'drive_firmware' => :'String', :'drive_state' => :'String', :'fde_capable' => :'String', :'hot_spare_type' => :'String', :'link_speed' => :'String', :'link_state' => :'String', :'num_blocks' => :'String', :'oper_power_state' => :'String', :'oper_qualifier_reason' => :'String', :'operability' => :'String', :'physical_block_size' => :'String', :'pid' => :'String', :'protocol' => :'String', :'raw_size' => :'String', :'secured' => :'String', :'size' => :'String', :'thermal' => :'String', :'type' => :'String', :'variant_type' => :'String', :'inventory_device_info' => :'InventoryDeviceInfoRelationship', :'locator_led' => :'EquipmentLocatorLedRelationship', :'physical_disk_extensions' => :'Array<StoragePhysicalDiskExtensionRelationship>', :'registered_device' => :'AssetDeviceRegistrationRelationship', :'running_firmware' => :'Array<FirmwareRunningFirmwareRelationship>', :'sas_ports' => :'Array<StorageSasPortRelationship>', :'storage_controller' => :'StorageControllerRelationship', :'storage_enclosure' => :'StorageEnclosureRelationship' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 482 def ==(o) return true if self.equal?(o) self.class == o.class && class_id == o.class_id && object_type == o.object_type && block_size == o.block_size && bootable == o.bootable && configuration_checkpoint == o.configuration_checkpoint && configuration_state == o.configuration_state && discovered_path == o.discovered_path && disk_id == o.disk_id && disk_state == o.disk_state && drive_firmware == o.drive_firmware && drive_state == o.drive_state && fde_capable == o.fde_capable && hot_spare_type == o.hot_spare_type && link_speed == o.link_speed && link_state == o.link_state && num_blocks == o.num_blocks && oper_power_state == o.oper_power_state && oper_qualifier_reason == o.oper_qualifier_reason && operability == o.operability && physical_block_size == o.physical_block_size && pid == o.pid && protocol == o.protocol && raw_size == o.raw_size && secured == o.secured && size == o.size && thermal == o.thermal && type == o.type && variant_type == o.variant_type && inventory_device_info == o.inventory_device_info && locator_led == o.locator_led && physical_disk_extensions == o.physical_disk_extensions && registered_device == o.registered_device && running_firmware == o.running_firmware && sas_ports == o.sas_ports && storage_controller == o.storage_controller && storage_enclosure == o.storage_enclosure && super(o) end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 569 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
640 641 642 643 644 645 646 647 648 649 650 651 652 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 640 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
545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 545 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) super(attributes) StoragePhysicalDisk.openapi_types.each_pair do |key, type| if attributes[StoragePhysicalDisk.attribute_map[key]].nil? && StoragePhysicalDisk.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[StoragePhysicalDisk.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[StoragePhysicalDisk.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[StoragePhysicalDisk.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[StoragePhysicalDisk.attribute_map[key]])) end end self end |
#eql?(o) ⇒ Boolean
525 526 527 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 525 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
531 532 533 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 531 def hash [class_id, object_type, block_size, bootable, configuration_checkpoint, configuration_state, discovered_path, disk_id, disk_state, drive_firmware, drive_state, fde_capable, hot_spare_type, link_speed, link_state, num_blocks, oper_power_state, oper_qualifier_reason, operability, physical_block_size, pid, protocol, raw_size, secured, size, thermal, type, variant_type, inventory_device_info, locator_led, physical_disk_extensions, registered_device, running_firmware, sas_ports, storage_controller, storage_enclosure].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
435 436 437 438 439 440 441 442 443 444 445 446 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 435 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)
616 617 618 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 616 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
622 623 624 625 626 627 628 629 630 631 632 633 634 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 622 def to_hash hash = super StoragePhysicalDisk.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = StoragePhysicalDisk.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
610 611 612 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 610 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
450 451 452 453 454 455 456 457 458 |
# File 'lib/intersight_client/models/storage_physical_disk.rb', line 450 def valid? return false if @class_id.nil? class_id_validator = EnumAttributeValidator.new('String', ["storage.PhysicalDisk"]) return false unless class_id_validator.valid?(@class_id) return false if @object_type.nil? object_type_validator = EnumAttributeValidator.new('String', ["storage.PhysicalDisk"]) return false unless object_type_validator.valid?(@object_type) true && super end |