Class: IntersightClient::StorageVirtualDriveAllOf
- Inherits:
-
Object
- Object
- IntersightClient::StorageVirtualDriveAllOf
- Defined in:
- lib/intersight_client/models/storage_virtual_drive_all_of.rb
Overview
Definition of the list of properties defined in ‘storage.VirtualDrive’, excluding properties defined in parent classes.
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#access_policy ⇒ Object
The access policy of the virtual drive.
-
#actual_write_cache_policy ⇒ Object
The current write cache policy of the virtual drive.
-
#available_size ⇒ Object
Available storage capacity of the virtual drive.
-
#block_size ⇒ Object
Block size of the virtual drive.
-
#bootable ⇒ Object
The virtual drive bootable state.
-
#class_id ⇒ Object
The fully-qualified name of the instantiated, concrete type.
-
#config_state ⇒ Object
The configuration state of the virtual drive.
-
#configured_write_cache_policy ⇒ Object
The requested write cache policy of the virtual drive.
-
#connection_protocol ⇒ Object
The connection protocol of the virtual drive.
-
#disk_group ⇒ Object
Returns the value of attribute disk_group.
-
#drive_cache ⇒ Object
The state of the drive cache of the virtual drive.
-
#drive_security ⇒ Object
The driveSecurity state of the Virtual drive.
-
#drive_state ⇒ Object
The state of the Virtual drive.
-
#inventory_device_info ⇒ Object
Returns the value of attribute inventory_device_info.
-
#io_policy ⇒ Object
The Input/Output Policy defined on the Virtual drive.
-
#name ⇒ Object
The name of the Virtual drive.
-
#num_blocks ⇒ Object
Number of Blocks on the Physical Disk.
-
#object_type ⇒ Object
The fully-qualified name of the instantiated, concrete type.
-
#oper_state ⇒ Object
The current operational state of Virtual drive.
-
#operability ⇒ Object
The current operability state of Virtual drive.
-
#physical_block_size ⇒ Object
The block size of the the virtual drive.
-
#physical_disk_usages ⇒ Object
An array of relationships to storagePhysicalDiskUsage resources.
-
#read_policy ⇒ Object
The read-ahead cache mode of the virtual drive.
-
#registered_device ⇒ Object
Returns the value of attribute registered_device.
-
#security_flags ⇒ Object
The security flags set for this virtual drive.
-
#size ⇒ Object
The size of the virtual drive in MB.
-
#storage_controller ⇒ Object
Returns the value of attribute storage_controller.
-
#storage_virtual_drive_container ⇒ Object
Returns the value of attribute storage_virtual_drive_container.
-
#strip_size ⇒ Object
The strip size is the portion of a stripe that resides on a single drive in the drive group, this is measured in KB.
-
#type ⇒ Object
The raid type of the virtual drive.
-
#uuid ⇒ Object
The uuid of the virtual drive.
-
#vd_member_eps ⇒ Object
An array of relationships to storageVdMemberEp resources.
-
#vendor_uuid ⇒ Object
The UUID value of the vendor.
-
#virtual_drive_extension ⇒ Object
Returns the value of attribute virtual_drive_extension.
-
#virtual_drive_id ⇒ Object
The identifier for this Virtual drive.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns the key-value map of all the JSON attributes this model knows about.
-
.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 = {}) ⇒ StorageVirtualDriveAllOf
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 = {}) ⇒ StorageVirtualDriveAllOf
Initializes the object
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 393 394 395 396 397 398 399 400 401 402 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 242 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `IntersightClient::StorageVirtualDriveAllOf` 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 } if attributes.key?(:'class_id') self.class_id = attributes[:'class_id'] else self.class_id = 'storage.VirtualDrive' end if attributes.key?(:'object_type') self.object_type = attributes[:'object_type'] else self.object_type = 'storage.VirtualDrive' end if attributes.key?(:'access_policy') self.access_policy = attributes[:'access_policy'] end if attributes.key?(:'actual_write_cache_policy') self.actual_write_cache_policy = attributes[:'actual_write_cache_policy'] end if attributes.key?(:'available_size') self.available_size = attributes[:'available_size'] 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?(:'config_state') self.config_state = attributes[:'config_state'] end if attributes.key?(:'configured_write_cache_policy') self.configured_write_cache_policy = attributes[:'configured_write_cache_policy'] end if attributes.key?(:'connection_protocol') self.connection_protocol = attributes[:'connection_protocol'] end if attributes.key?(:'drive_cache') self.drive_cache = attributes[:'drive_cache'] end if attributes.key?(:'drive_security') self.drive_security = attributes[:'drive_security'] end if attributes.key?(:'drive_state') self.drive_state = attributes[:'drive_state'] end if attributes.key?(:'io_policy') self.io_policy = attributes[:'io_policy'] end if attributes.key?(:'name') self.name = attributes[:'name'] end if attributes.key?(:'num_blocks') self.num_blocks = attributes[:'num_blocks'] end if attributes.key?(:'oper_state') self.oper_state = attributes[:'oper_state'] 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?(:'read_policy') self.read_policy = attributes[:'read_policy'] end if attributes.key?(:'security_flags') self.security_flags = attributes[:'security_flags'] end if attributes.key?(:'size') self.size = attributes[:'size'] end if attributes.key?(:'strip_size') self.strip_size = attributes[:'strip_size'] end if attributes.key?(:'type') self.type = attributes[:'type'] end if attributes.key?(:'uuid') self.uuid = attributes[:'uuid'] end if attributes.key?(:'vendor_uuid') self.vendor_uuid = attributes[:'vendor_uuid'] end if attributes.key?(:'virtual_drive_id') self.virtual_drive_id = attributes[:'virtual_drive_id'] end if attributes.key?(:'disk_group') self.disk_group = attributes[:'disk_group'] end if attributes.key?(:'inventory_device_info') self.inventory_device_info = attributes[:'inventory_device_info'] end if attributes.key?(:'physical_disk_usages') if (value = attributes[:'physical_disk_usages']).is_a?(Array) self.physical_disk_usages = value end end if attributes.key?(:'registered_device') self.registered_device = attributes[:'registered_device'] end if attributes.key?(:'storage_controller') self.storage_controller = attributes[:'storage_controller'] end if attributes.key?(:'storage_virtual_drive_container') self.storage_virtual_drive_container = attributes[:'storage_virtual_drive_container'] end if attributes.key?(:'vd_member_eps') if (value = attributes[:'vd_member_eps']).is_a?(Array) self.vd_member_eps = value end end if attributes.key?(:'virtual_drive_extension') self.virtual_drive_extension = attributes[:'virtual_drive_extension'] end end |
Instance Attribute Details
#access_policy ⇒ Object
The access policy of the virtual drive.
26 27 28 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 26 def access_policy @access_policy end |
#actual_write_cache_policy ⇒ Object
The current write cache policy of the virtual drive.
29 30 31 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 29 def actual_write_cache_policy @actual_write_cache_policy end |
#available_size ⇒ Object
Available storage capacity of the virtual drive.
32 33 34 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 32 def available_size @available_size end |
#block_size ⇒ Object
Block size of the virtual drive.
35 36 37 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 35 def block_size @block_size end |
#bootable ⇒ Object
The virtual drive bootable state.
38 39 40 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 38 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_virtual_drive_all_of.rb', line 20 def class_id @class_id end |
#config_state ⇒ Object
The configuration state of the virtual drive.
41 42 43 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 41 def config_state @config_state end |
#configured_write_cache_policy ⇒ Object
The requested write cache policy of the virtual drive.
44 45 46 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 44 def configured_write_cache_policy @configured_write_cache_policy end |
#connection_protocol ⇒ Object
The connection protocol of the virtual drive.
47 48 49 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 47 def connection_protocol @connection_protocol end |
#disk_group ⇒ Object
Returns the value of attribute disk_group.
100 101 102 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 100 def disk_group @disk_group end |
#drive_cache ⇒ Object
The state of the drive cache of the virtual drive.
50 51 52 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 50 def drive_cache @drive_cache end |
#drive_security ⇒ Object
The driveSecurity state of the Virtual drive.
53 54 55 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 53 def drive_security @drive_security end |
#drive_state ⇒ Object
The state of the Virtual drive.
56 57 58 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 56 def drive_state @drive_state end |
#inventory_device_info ⇒ Object
Returns the value of attribute inventory_device_info.
102 103 104 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 102 def inventory_device_info @inventory_device_info end |
#io_policy ⇒ Object
The Input/Output Policy defined on the Virtual drive.
59 60 61 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 59 def io_policy @io_policy end |
#name ⇒ Object
The name of the Virtual drive.
62 63 64 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 62 def name @name end |
#num_blocks ⇒ Object
Number of Blocks on the Physical Disk.
65 66 67 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.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_virtual_drive_all_of.rb', line 23 def object_type @object_type end |
#oper_state ⇒ Object
The current operational state of Virtual drive.
68 69 70 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 68 def oper_state @oper_state end |
#operability ⇒ Object
The current operability state of Virtual drive.
71 72 73 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 71 def operability @operability end |
#physical_block_size ⇒ Object
The block size of the the virtual drive.
74 75 76 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 74 def physical_block_size @physical_block_size end |
#physical_disk_usages ⇒ Object
An array of relationships to storagePhysicalDiskUsage resources.
105 106 107 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 105 def physical_disk_usages @physical_disk_usages end |
#read_policy ⇒ Object
The read-ahead cache mode of the virtual drive.
77 78 79 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 77 def read_policy @read_policy end |
#registered_device ⇒ Object
Returns the value of attribute registered_device.
107 108 109 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 107 def registered_device @registered_device end |
#security_flags ⇒ Object
The security flags set for this virtual drive.
80 81 82 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 80 def security_flags @security_flags end |
#size ⇒ Object
The size of the virtual drive in MB.
83 84 85 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 83 def size @size end |
#storage_controller ⇒ Object
Returns the value of attribute storage_controller.
109 110 111 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 109 def storage_controller @storage_controller end |
#storage_virtual_drive_container ⇒ Object
Returns the value of attribute storage_virtual_drive_container.
111 112 113 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 111 def storage_virtual_drive_container @storage_virtual_drive_container end |
#strip_size ⇒ Object
The strip size is the portion of a stripe that resides on a single drive in the drive group, this is measured in KB.
86 87 88 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 86 def strip_size @strip_size end |
#type ⇒ Object
The raid type of the virtual drive.
89 90 91 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 89 def type @type end |
#uuid ⇒ Object
The uuid of the virtual drive.
92 93 94 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 92 def uuid @uuid end |
#vd_member_eps ⇒ Object
An array of relationships to storageVdMemberEp resources.
114 115 116 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 114 def vd_member_eps @vd_member_eps end |
#vendor_uuid ⇒ Object
The UUID value of the vendor.
95 96 97 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 95 def vendor_uuid @vendor_uuid end |
#virtual_drive_extension ⇒ Object
Returns the value of attribute virtual_drive_extension.
116 117 118 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 116 def virtual_drive_extension @virtual_drive_extension end |
#virtual_drive_id ⇒ Object
The identifier for this Virtual drive.
98 99 100 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 98 def virtual_drive_id @virtual_drive_id end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns the key-value map of all the JSON attributes this model knows about
187 188 189 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 187 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
182 183 184 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 182 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
141 142 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 172 173 174 175 176 177 178 179 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 141 def self.attribute_map { :'class_id' => :'ClassId', :'object_type' => :'ObjectType', :'access_policy' => :'AccessPolicy', :'actual_write_cache_policy' => :'ActualWriteCachePolicy', :'available_size' => :'AvailableSize', :'block_size' => :'BlockSize', :'bootable' => :'Bootable', :'config_state' => :'ConfigState', :'configured_write_cache_policy' => :'ConfiguredWriteCachePolicy', :'connection_protocol' => :'ConnectionProtocol', :'drive_cache' => :'DriveCache', :'drive_security' => :'DriveSecurity', :'drive_state' => :'DriveState', :'io_policy' => :'IoPolicy', :'name' => :'Name', :'num_blocks' => :'NumBlocks', :'oper_state' => :'OperState', :'operability' => :'Operability', :'physical_block_size' => :'PhysicalBlockSize', :'read_policy' => :'ReadPolicy', :'security_flags' => :'SecurityFlags', :'size' => :'Size', :'strip_size' => :'StripSize', :'type' => :'Type', :'uuid' => :'Uuid', :'vendor_uuid' => :'VendorUuid', :'virtual_drive_id' => :'VirtualDriveId', :'disk_group' => :'DiskGroup', :'inventory_device_info' => :'InventoryDeviceInfo', :'physical_disk_usages' => :'PhysicalDiskUsages', :'registered_device' => :'RegisteredDevice', :'storage_controller' => :'StorageController', :'storage_virtual_drive_container' => :'StorageVirtualDriveContainer', :'vd_member_eps' => :'VdMemberEps', :'virtual_drive_extension' => :'VirtualDriveExtension' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
508 509 510 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 508 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
233 234 235 236 237 238 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 233 def self.openapi_nullable Set.new([ :'physical_disk_usages', :'vd_member_eps', ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 192 def self.openapi_types { :'class_id' => :'String', :'object_type' => :'String', :'access_policy' => :'String', :'actual_write_cache_policy' => :'String', :'available_size' => :'String', :'block_size' => :'String', :'bootable' => :'String', :'config_state' => :'String', :'configured_write_cache_policy' => :'String', :'connection_protocol' => :'String', :'drive_cache' => :'String', :'drive_security' => :'String', :'drive_state' => :'String', :'io_policy' => :'String', :'name' => :'String', :'num_blocks' => :'String', :'oper_state' => :'String', :'operability' => :'String', :'physical_block_size' => :'String', :'read_policy' => :'String', :'security_flags' => :'String', :'size' => :'String', :'strip_size' => :'String', :'type' => :'String', :'uuid' => :'String', :'vendor_uuid' => :'String', :'virtual_drive_id' => :'String', :'disk_group' => :'StorageDiskGroupRelationship', :'inventory_device_info' => :'InventoryDeviceInfoRelationship', :'physical_disk_usages' => :'Array<StoragePhysicalDiskUsageRelationship>', :'registered_device' => :'AssetDeviceRegistrationRelationship', :'storage_controller' => :'StorageControllerRelationship', :'storage_virtual_drive_container' => :'StorageVirtualDriveContainerRelationship', :'vd_member_eps' => :'Array<StorageVdMemberEpRelationship>', :'virtual_drive_extension' => :'StorageVirtualDriveExtensionRelationship' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 453 def ==(o) return true if self.equal?(o) self.class == o.class && class_id == o.class_id && object_type == o.object_type && access_policy == o.access_policy && actual_write_cache_policy == o.actual_write_cache_policy && available_size == o.available_size && block_size == o.block_size && bootable == o.bootable && config_state == o.config_state && configured_write_cache_policy == o.configured_write_cache_policy && connection_protocol == o.connection_protocol && drive_cache == o.drive_cache && drive_security == o.drive_security && drive_state == o.drive_state && io_policy == o.io_policy && name == o.name && num_blocks == o.num_blocks && oper_state == o.oper_state && operability == o.operability && physical_block_size == o.physical_block_size && read_policy == o.read_policy && security_flags == o.security_flags && size == o.size && strip_size == o.strip_size && type == o.type && uuid == o.uuid && vendor_uuid == o.vendor_uuid && virtual_drive_id == o.virtual_drive_id && disk_group == o.disk_group && inventory_device_info == o.inventory_device_info && physical_disk_usages == o.physical_disk_usages && registered_device == o.registered_device && storage_controller == o.storage_controller && storage_virtual_drive_container == o.storage_virtual_drive_container && vd_member_eps == o.vd_member_eps && virtual_drive_extension == o.virtual_drive_extension end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 538 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
609 610 611 612 613 614 615 616 617 618 619 620 621 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 609 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
515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 515 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) StorageVirtualDriveAllOf.openapi_types.each_pair do |key, type| if attributes[StorageVirtualDriveAllOf.attribute_map[key]].nil? && StorageVirtualDriveAllOf.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[StorageVirtualDriveAllOf.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[StorageVirtualDriveAllOf.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[StorageVirtualDriveAllOf.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[StorageVirtualDriveAllOf.attribute_map[key]])) end end self end |
#eql?(o) ⇒ Boolean
495 496 497 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 495 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
501 502 503 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 501 def hash [class_id, object_type, access_policy, actual_write_cache_policy, available_size, block_size, bootable, config_state, configured_write_cache_policy, connection_protocol, drive_cache, drive_security, drive_state, io_policy, name, num_blocks, oper_state, operability, physical_block_size, read_policy, security_flags, size, strip_size, type, uuid, vendor_uuid, virtual_drive_id, disk_group, inventory_device_info, physical_disk_usages, registered_device, storage_controller, storage_virtual_drive_container, vd_member_eps, virtual_drive_extension].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
406 407 408 409 410 411 412 413 414 415 416 417 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 406 def list_invalid_properties invalid_properties = Array.new 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)
585 586 587 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 585 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
591 592 593 594 595 596 597 598 599 600 601 602 603 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 591 def to_hash hash = {} StorageVirtualDriveAllOf.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = StorageVirtualDriveAllOf.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
579 580 581 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 579 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
421 422 423 424 425 426 427 428 429 |
# File 'lib/intersight_client/models/storage_virtual_drive_all_of.rb', line 421 def valid? return false if @class_id.nil? class_id_validator = EnumAttributeValidator.new('String', ["storage.VirtualDrive"]) return false unless class_id_validator.valid?(@class_id) return false if @object_type.nil? object_type_validator = EnumAttributeValidator.new('String', ["storage.VirtualDrive"]) return false unless object_type_validator.valid?(@object_type) true end |