Class: MistApi::VirtualChassisMemberUpdate
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- MistApi::VirtualChassisMemberUpdate
- Defined in:
- lib/mist_api/models/virtual_chassis_member_update.rb
Overview
VirtualChassisMemberUpdate Model.
Instance Attribute Summary collapse
-
#mac ⇒ String
Required if ‘op`==`add` or `op`==`preprovision`.
-
#member ⇒ Integer
Required if ‘op`==`remove`.
-
#member_id ⇒ Integer
Required if ‘op`==`preprovision`.
-
#vc_ports ⇒ Array[String]
Required if ‘op`==`add` or `op`==`preprovision`.
-
#vc_role ⇒ VirtualChassisMemberUpdateVcRoleEnum
Required if ‘op`==`add` or `op`==`preprovision`.
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(mac = SKIP, member = SKIP, member_id = SKIP, vc_ports = SKIP, vc_role = SKIP) ⇒ VirtualChassisMemberUpdate
constructor
A new instance of VirtualChassisMemberUpdate.
-
#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(mac = SKIP, member = SKIP, member_id = SKIP, vc_ports = SKIP, vc_role = SKIP) ⇒ VirtualChassisMemberUpdate
Returns a new instance of VirtualChassisMemberUpdate.
60 61 62 63 64 65 66 67 |
# File 'lib/mist_api/models/virtual_chassis_member_update.rb', line 60 def initialize(mac = SKIP, member = SKIP, member_id = SKIP, vc_ports = SKIP, vc_role = SKIP) @mac = mac unless mac == SKIP @member = member unless member == SKIP @member_id = member_id unless member_id == SKIP @vc_ports = vc_ports unless vc_ports == SKIP @vc_role = vc_role unless vc_role == SKIP end |
Instance Attribute Details
#mac ⇒ String
Required if ‘op`==`add` or `op`==`preprovision`.
14 15 16 |
# File 'lib/mist_api/models/virtual_chassis_member_update.rb', line 14 def mac @mac end |
#member ⇒ Integer
Required if ‘op`==`remove`
18 19 20 |
# File 'lib/mist_api/models/virtual_chassis_member_update.rb', line 18 def member @member end |
#member_id ⇒ Integer
Required if ‘op`==`preprovision`. Optional if `op`==`add`
22 23 24 |
# File 'lib/mist_api/models/virtual_chassis_member_update.rb', line 22 def member_id @member_id end |
#vc_ports ⇒ Array[String]
Required if ‘op`==`add` or `op`==`preprovision`
26 27 28 |
# File 'lib/mist_api/models/virtual_chassis_member_update.rb', line 26 def vc_ports @vc_ports end |
#vc_role ⇒ VirtualChassisMemberUpdateVcRoleEnum
Required if ‘op`==`add` or `op`==`preprovision`. enum: `backup`, `linecard`, `master`
31 32 33 |
# File 'lib/mist_api/models/virtual_chassis_member_update.rb', line 31 def vc_role @vc_role end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/mist_api/models/virtual_chassis_member_update.rb', line 70 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. mac = hash.key?('mac') ? hash['mac'] : SKIP member = hash.key?('member') ? hash['member'] : SKIP member_id = hash.key?('member_id') ? hash['member_id'] : SKIP vc_ports = hash.key?('vc_ports') ? hash['vc_ports'] : SKIP vc_role = hash.key?('vc_role') ? hash['vc_role'] : SKIP # Create object from extracted values. VirtualChassisMemberUpdate.new(mac, member, member_id, vc_ports, vc_role) end |
.names ⇒ Object
A mapping from model property names to API property names.
34 35 36 37 38 39 40 41 42 |
# File 'lib/mist_api/models/virtual_chassis_member_update.rb', line 34 def self.names @_hash = {} if @_hash.nil? @_hash['mac'] = 'mac' @_hash['member'] = 'member' @_hash['member_id'] = 'member_id' @_hash['vc_ports'] = 'vc_ports' @_hash['vc_role'] = 'vc_role' @_hash end |
.nullables ⇒ Object
An array for nullable fields
56 57 58 |
# File 'lib/mist_api/models/virtual_chassis_member_update.rb', line 56 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
45 46 47 48 49 50 51 52 53 |
# File 'lib/mist_api/models/virtual_chassis_member_update.rb', line 45 def self.optionals %w[ mac member member_id vc_ports vc_role ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
96 97 98 99 100 |
# File 'lib/mist_api/models/virtual_chassis_member_update.rb', line 96 def inspect class_name = self.class.name.split('::').last "<#{class_name} mac: #{@mac.inspect}, member: #{@member.inspect}, member_id:"\ " #{@member_id.inspect}, vc_ports: #{@vc_ports.inspect}, vc_role: #{@vc_role.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
89 90 91 92 93 |
# File 'lib/mist_api/models/virtual_chassis_member_update.rb', line 89 def to_s class_name = self.class.name.split('::').last "<#{class_name} mac: #{@mac}, member: #{@member}, member_id: #{@member_id}, vc_ports:"\ " #{@vc_ports}, vc_role: #{@vc_role}>" end |