Class: MistApi::SwitchVirtualChassis
- Defined in:
- lib/mist_api/models/switch_virtual_chassis.rb
Overview
Required for preprovisioned Virtual Chassis
Instance Attribute Summary collapse
-
#members ⇒ Array[SwitchVirtualChassisMember]
List of Virtual Chassis members.
-
#preprovisioned ⇒ TrueClass | FalseClass
To configure whether the VC is preprovisioned or nonprovisioned.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(members = SKIP, preprovisioned = false) ⇒ SwitchVirtualChassis
constructor
A new instance of SwitchVirtualChassis.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(members = SKIP, preprovisioned = false) ⇒ SwitchVirtualChassis
Returns a new instance of SwitchVirtualChassis.
41 42 43 44 |
# File 'lib/mist_api/models/switch_virtual_chassis.rb', line 41 def initialize(members = SKIP, preprovisioned = false) @members = members unless members == SKIP @preprovisioned = preprovisioned unless preprovisioned == SKIP end |
Instance Attribute Details
#members ⇒ Array[SwitchVirtualChassisMember]
List of Virtual Chassis members
14 15 16 |
# File 'lib/mist_api/models/switch_virtual_chassis.rb', line 14 def members @members end |
#preprovisioned ⇒ TrueClass | FalseClass
To configure whether the VC is preprovisioned or nonprovisioned
18 19 20 |
# File 'lib/mist_api/models/switch_virtual_chassis.rb', line 18 def preprovisioned @preprovisioned end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/mist_api/models/switch_virtual_chassis.rb', line 47 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. # Parameter is an array, so we need to iterate through it members = nil unless hash['members'].nil? members = [] hash['members'].each do |structure| members << (SwitchVirtualChassisMember.from_hash(structure) if structure) end end members = SKIP unless hash.key?('members') preprovisioned = hash['preprovisioned'] ||= false # Create object from extracted values. SwitchVirtualChassis.new(members, preprovisioned) end |
.names ⇒ Object
A mapping from model property names to API property names.
21 22 23 24 25 26 |
# File 'lib/mist_api/models/switch_virtual_chassis.rb', line 21 def self.names @_hash = {} if @_hash.nil? @_hash['members'] = 'members' @_hash['preprovisioned'] = 'preprovisioned' @_hash end |
.nullables ⇒ Object
An array for nullable fields
37 38 39 |
# File 'lib/mist_api/models/switch_virtual_chassis.rb', line 37 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
29 30 31 32 33 34 |
# File 'lib/mist_api/models/switch_virtual_chassis.rb', line 29 def self.optionals %w[ members preprovisioned ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
75 76 77 78 |
# File 'lib/mist_api/models/switch_virtual_chassis.rb', line 75 def inspect class_name = self.class.name.split('::').last "<#{class_name} members: #{@members.inspect}, preprovisioned: #{@preprovisioned.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
69 70 71 72 |
# File 'lib/mist_api/models/switch_virtual_chassis.rb', line 69 def to_s class_name = self.class.name.split('::').last "<#{class_name} members: #{@members}, preprovisioned: #{@preprovisioned}>" end |