Class: MistApi::ResponseVirtualChassisConfig

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/mist_api/models/response_virtual_chassis_config.rb

Overview

ResponseVirtualChassisConfig Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(config_type = SKIP, id = SKIP, locating = SKIP, mac = SKIP, members = SKIP, model = SKIP, num_routing_engines = SKIP, org_id = SKIP, serial = SKIP, site_id = SKIP, status = SKIP, type = SKIP, vc_mac = SKIP) ⇒ ResponseVirtualChassisConfig

Returns a new instance of ResponseVirtualChassisConfig.



107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/mist_api/models/response_virtual_chassis_config.rb', line 107

def initialize(config_type = SKIP, id = SKIP, locating = SKIP, mac = SKIP,
               members = SKIP, model = SKIP, num_routing_engines = SKIP,
               org_id = SKIP, serial = SKIP, site_id = SKIP, status = SKIP,
               type = SKIP, vc_mac = SKIP)
  @config_type = config_type unless config_type == SKIP
  @id = id unless id == SKIP
  @locating = locating unless locating == SKIP
  @mac = mac unless mac == SKIP
  @members = members unless members == SKIP
  @model = model unless model == SKIP
  @num_routing_engines = num_routing_engines unless num_routing_engines == SKIP
  @org_id = org_id unless org_id == SKIP
  @serial = serial unless serial == SKIP
  @site_id = site_id unless site_id == SKIP
  @status = status unless status == SKIP
  @type = type unless type == SKIP
  @vc_mac = vc_mac unless vc_mac == SKIP
end

Instance Attribute Details

#config_typeString

TODO: Write general description for this method

Returns:

  • (String)


14
15
16
# File 'lib/mist_api/models/response_virtual_chassis_config.rb', line 14

def config_type
  @config_type
end

#idUUID | String

Unique ID of the object instance in the Mist Organization

Returns:

  • (UUID | String)


18
19
20
# File 'lib/mist_api/models/response_virtual_chassis_config.rb', line 18

def id
  @id
end

#locatingTrueClass | FalseClass

Unique ID of the object instance in the Mist Organization

Returns:

  • (TrueClass | FalseClass)


22
23
24
# File 'lib/mist_api/models/response_virtual_chassis_config.rb', line 22

def locating
  @locating
end

#macString

Unique ID of the object instance in the Mist Organization

Returns:

  • (String)


26
27
28
# File 'lib/mist_api/models/response_virtual_chassis_config.rb', line 26

def mac
  @mac
end

#membersArray[StatsSwitchModuleStatItem]

Unique ID of the object instance in the Mist Organization

Returns:



30
31
32
# File 'lib/mist_api/models/response_virtual_chassis_config.rb', line 30

def members
  @members
end

#modelString

Unique ID of the object instance in the Mist Organization

Returns:

  • (String)


34
35
36
# File 'lib/mist_api/models/response_virtual_chassis_config.rb', line 34

def model
  @model
end

#num_routing_enginesInteger

routing-engine count

Returns:

  • (Integer)


38
39
40
# File 'lib/mist_api/models/response_virtual_chassis_config.rb', line 38

def num_routing_engines
  @num_routing_engines
end

#org_idUUID | String

routing-engine count

Returns:

  • (UUID | String)


42
43
44
# File 'lib/mist_api/models/response_virtual_chassis_config.rb', line 42

def org_id
  @org_id
end

#serialString

routing-engine count

Returns:

  • (String)


46
47
48
# File 'lib/mist_api/models/response_virtual_chassis_config.rb', line 46

def serial
  @serial
end

#site_idUUID | String

routing-engine count

Returns:

  • (UUID | String)


50
51
52
# File 'lib/mist_api/models/response_virtual_chassis_config.rb', line 50

def site_id
  @site_id
end

#statusString

routing-engine count

Returns:

  • (String)


54
55
56
# File 'lib/mist_api/models/response_virtual_chassis_config.rb', line 54

def status
  @status
end

#typeString

routing-engine count

Returns:

  • (String)


58
59
60
# File 'lib/mist_api/models/response_virtual_chassis_config.rb', line 58

def type
  @type
end

#vc_macString

routing-engine count

Returns:

  • (String)


62
63
64
# File 'lib/mist_api/models/response_virtual_chassis_config.rb', line 62

def vc_mac
  @vc_mac
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



127
128
129
130
131
132
133
134
135
136
137
138
139
140
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
# File 'lib/mist_api/models/response_virtual_chassis_config.rb', line 127

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  config_type = hash.key?('config_type') ? hash['config_type'] : SKIP
  id = hash.key?('id') ? hash['id'] : SKIP
  locating = hash.key?('locating') ? hash['locating'] : SKIP
  mac = hash.key?('mac') ? hash['mac'] : SKIP
  # Parameter is an array, so we need to iterate through it
  members = nil
  unless hash['members'].nil?
    members = []
    hash['members'].each do |structure|
      members << (StatsSwitchModuleStatItem.from_hash(structure) if structure)
    end
  end

  members = SKIP unless hash.key?('members')
  model = hash.key?('model') ? hash['model'] : SKIP
  num_routing_engines =
    hash.key?('num_routing_engines') ? hash['num_routing_engines'] : SKIP
  org_id = hash.key?('org_id') ? hash['org_id'] : SKIP
  serial = hash.key?('serial') ? hash['serial'] : SKIP
  site_id = hash.key?('site_id') ? hash['site_id'] : SKIP
  status = hash.key?('status') ? hash['status'] : SKIP
  type = hash.key?('type') ? hash['type'] : SKIP
  vc_mac = hash.key?('vc_mac') ? hash['vc_mac'] : SKIP

  # Create object from extracted values.
  ResponseVirtualChassisConfig.new(config_type,
                                   id,
                                   locating,
                                   mac,
                                   members,
                                   model,
                                   num_routing_engines,
                                   org_id,
                                   serial,
                                   site_id,
                                   status,
                                   type,
                                   vc_mac)
end

.namesObject

A mapping from model property names to API property names.



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/mist_api/models/response_virtual_chassis_config.rb', line 65

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['config_type'] = 'config_type'
  @_hash['id'] = 'id'
  @_hash['locating'] = 'locating'
  @_hash['mac'] = 'mac'
  @_hash['members'] = 'members'
  @_hash['model'] = 'model'
  @_hash['num_routing_engines'] = 'num_routing_engines'
  @_hash['org_id'] = 'org_id'
  @_hash['serial'] = 'serial'
  @_hash['site_id'] = 'site_id'
  @_hash['status'] = 'status'
  @_hash['type'] = 'type'
  @_hash['vc_mac'] = 'vc_mac'
  @_hash
end

.nullablesObject

An array for nullable fields



103
104
105
# File 'lib/mist_api/models/response_virtual_chassis_config.rb', line 103

def self.nullables
  []
end

.optionalsObject

An array for optional fields



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/mist_api/models/response_virtual_chassis_config.rb', line 84

def self.optionals
  %w[
    config_type
    id
    locating
    mac
    members
    model
    num_routing_engines
    org_id
    serial
    site_id
    status
    type
    vc_mac
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



181
182
183
184
185
186
187
188
# File 'lib/mist_api/models/response_virtual_chassis_config.rb', line 181

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} config_type: #{@config_type.inspect}, id: #{@id.inspect}, locating:"\
  " #{@locating.inspect}, mac: #{@mac.inspect}, members: #{@members.inspect}, model:"\
  " #{@model.inspect}, num_routing_engines: #{@num_routing_engines.inspect}, org_id:"\
  " #{@org_id.inspect}, serial: #{@serial.inspect}, site_id: #{@site_id.inspect}, status:"\
  " #{@status.inspect}, type: #{@type.inspect}, vc_mac: #{@vc_mac.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



172
173
174
175
176
177
178
# File 'lib/mist_api/models/response_virtual_chassis_config.rb', line 172

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} config_type: #{@config_type}, id: #{@id}, locating: #{@locating}, mac:"\
  " #{@mac}, members: #{@members}, model: #{@model}, num_routing_engines:"\
  " #{@num_routing_engines}, org_id: #{@org_id}, serial: #{@serial}, site_id: #{@site_id},"\
  " status: #{@status}, type: #{@type}, vc_mac: #{@vc_mac}>"
end