Class: IntersightClient::ComputeRackUnitAllOf

Inherits:
Object
  • Object
show all
Defined in:
lib/intersight_client/models/compute_rack_unit_all_of.rb

Overview

Definition of the list of properties defined in ‘compute.RackUnit’, excluding properties defined in parent classes.

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ComputeRackUnitAllOf

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



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
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
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 218

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `IntersightClient::ComputeRackUnitAllOf` 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 = '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.sas_expanders = 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

#adaptersObject

An array of relationships to adapterUnit resources.



35
36
37
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 35

def adapters
  @adapters
end

#bios_bootmodeObject

Returns the value of attribute bios_bootmode.



37
38
39
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 37

def bios_bootmode
  @bios_bootmode
end

#bios_token_settingsObject

Returns the value of attribute bios_token_settings.



39
40
41
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 39

def bios_token_settings
  @bios_token_settings
end

#bios_vf_select_memory_ras_configurationObject

Returns the value of attribute bios_vf_select_memory_ras_configuration.



41
42
43
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 41

def bios_vf_select_memory_ras_configuration
  @bios_vf_select_memory_ras_configuration
end

#biosunitsObject

An array of relationships to biosUnit resources.



44
45
46
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 44

def biosunits
  @biosunits
end

#bmcObject

Returns the value of attribute bmc.



46
47
48
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 46

def bmc
  @bmc
end

#boardObject

Returns the value of attribute board.



48
49
50
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 48

def board
  @board
end

#boot_device_bootmodeObject

Returns the value of attribute boot_device_bootmode.



50
51
52
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 50

def boot_device_bootmode
  @boot_device_bootmode
end

#class_idObject

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_all_of.rb', line 20

def class_id
  @class_id
end

#connection_statusObject

Connectivity Status of RackUnit to Switch - A or B or AB.



26
27
28
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 26

def connection_status
  @connection_status
end

#fanmodulesObject

An array of relationships to equipmentFanModule resources.



53
54
55
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 53

def fanmodules
  @fanmodules
end

#generic_inventory_holdersObject

An array of relationships to inventoryGenericInventoryHolder resources.



56
57
58
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 56

def generic_inventory_holders
  @generic_inventory_holders
end

#graphics_cardsObject

An array of relationships to graphicsCard resources.



59
60
61
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 59

def graphics_cards
  @graphics_cards
end

#inventory_device_infoObject

Returns the value of attribute inventory_device_info.



61
62
63
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 61

def inventory_device_info
  @inventory_device_info
end

#locator_ledObject

Returns the value of attribute locator_led.



63
64
65
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 63

def locator_led
  @locator_led
end

#memory_arraysObject

An array of relationships to memoryArray resources.



66
67
68
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 66

def memory_arrays
  @memory_arrays
end

#object_typeObject

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_all_of.rb', line 23

def object_type
  @object_type
end

#pci_devicesObject

An array of relationships to pciDevice resources.



69
70
71
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 69

def pci_devices
  @pci_devices
end

#processorsObject

An array of relationships to processorUnit resources.



72
73
74
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 72

def processors
  @processors
end

#psusObject

An array of relationships to equipmentPsu resources.



75
76
77
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 75

def psus
  @psus
end

#rack_enclosure_slotObject

Returns the value of attribute rack_enclosure_slot.



77
78
79
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 77

def rack_enclosure_slot
  @rack_enclosure_slot
end

#registered_deviceObject

Returns the value of attribute registered_device.



79
80
81
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 79

def registered_device
  @registered_device
end

#sas_expandersObject

An array of relationships to storageSasExpander resources.



82
83
84
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 82

def sas_expanders
  @sas_expanders
end

#server_idObject

RackUnit ID that uniquely identifies the server.



29
30
31
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 29

def server_id
  @server_id
end

#storage_controllersObject

An array of relationships to storageController resources.



85
86
87
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 85

def storage_controllers
  @storage_controllers
end

#storage_enclosuresObject

An array of relationships to storageEnclosure resources.



88
89
90
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 88

def storage_enclosures
  @storage_enclosures
end

#top_systemObject

Returns the value of attribute top_system.



90
91
92
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 90

def top_system
  @top_system
end

#topology_scan_statusObject

To maintain the Topology workflow run status.



32
33
34
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 32

def topology_scan_status
  @topology_scan_status
end

#unit_personalityObject

An array of relationships to rackUnitPersonality resources.



93
94
95
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 93

def unit_personality
  @unit_personality
end

Class Method Details

.acceptable_attribute_mapObject

Returns the key-value map of all the JSON attributes this model knows about



158
159
160
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 158

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



153
154
155
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 153

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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_all_of.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

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



476
477
478
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 476

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

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_all_of.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_typesObject

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_all_of.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.

Parameters:

  • Object (Object)

    to be compared



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
457
458
459
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 427

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 &&
      sas_expanders == o.sas_expanders &&
      storage_controllers == o.storage_controllers &&
      storage_enclosures == o.storage_enclosures &&
      top_system == o.top_system &&
      unit_personality == o.unit_personality
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 506

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

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



577
578
579
580
581
582
583
584
585
586
587
588
589
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 577

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

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 483

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  ComputeRackUnitAllOf.openapi_types.each_pair do |key, type|
    if attributes[ComputeRackUnitAllOf.attribute_map[key]].nil? && ComputeRackUnitAllOf.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[ComputeRackUnitAllOf.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[ComputeRackUnitAllOf.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[ComputeRackUnitAllOf.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[ComputeRackUnitAllOf.attribute_map[key]]))
    end
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


463
464
465
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 463

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



469
470
471
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 469

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, sas_expanders, storage_controllers, storage_enclosures, top_system, unit_personality].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



380
381
382
383
384
385
386
387
388
389
390
391
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 380

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_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



553
554
555
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 553

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



559
560
561
562
563
564
565
566
567
568
569
570
571
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 559

def to_hash
  hash = {}
  ComputeRackUnitAllOf.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = ComputeRackUnitAllOf.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



547
548
549
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 547

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



395
396
397
398
399
400
401
402
403
# File 'lib/intersight_client/models/compute_rack_unit_all_of.rb', line 395

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
end