Class: MistApi::ConstDeviceSwitch

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

Overview

ConstDeviceSwitch 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(malias = SKIP, defaults = SKIP, description = SKIP, display = SKIP, evolved_os = false, evpn_ri_type = SKIP, experimental = false, fans_pluggable = false, has_bgp = false, has_ets = false, has_evpn = false, has_irb = false, has_poe_out = false, has_snapshot = true, has_vc = true, model = SKIP, modular = false, no_shaping_rate = false, number_fans = SKIP, oc_device = false, oob_interface = SKIP, packet_action_drop_only = false, pic = SKIP, sub_required = SKIP, additional_properties = nil) ⇒ ConstDeviceSwitch

Returns a new instance of ConstDeviceSwitch.



178
179
180
181
182
183
184
185
186
187
188
189
190
191
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
# File 'lib/mist_api/models/const_device_switch.rb', line 178

def initialize(malias = SKIP, defaults = SKIP, description = SKIP,
               display = SKIP, evolved_os = false, evpn_ri_type = SKIP,
               experimental = false, fans_pluggable = false,
               has_bgp = false, has_ets = false, has_evpn = false,
               has_irb = false, has_poe_out = false, has_snapshot = true,
               has_vc = true, model = SKIP, modular = false,
               no_shaping_rate = false, number_fans = SKIP,
               oc_device = false, oob_interface = SKIP,
               packet_action_drop_only = false, pic = SKIP,
               sub_required = SKIP, additional_properties = nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @malias = malias unless malias == SKIP
  @defaults = defaults unless defaults == SKIP
  @description = description unless description == SKIP
  @display = display unless display == SKIP
  @evolved_os = evolved_os unless evolved_os == SKIP
  @evpn_ri_type = evpn_ri_type unless evpn_ri_type == SKIP
  @experimental = experimental unless experimental == SKIP
  @fans_pluggable = fans_pluggable unless fans_pluggable == SKIP
  @has_bgp = has_bgp unless has_bgp == SKIP
  @has_ets = has_ets unless has_ets == SKIP
  @has_evpn = has_evpn unless has_evpn == SKIP
  @has_irb = has_irb unless has_irb == SKIP
  @has_poe_out = has_poe_out unless has_poe_out == SKIP
  @has_snapshot = has_snapshot unless has_snapshot == SKIP
  @has_vc = has_vc unless has_vc == SKIP
  @model = model unless model == SKIP
  @modular = modular unless modular == SKIP
  @no_shaping_rate = no_shaping_rate unless no_shaping_rate == SKIP
  @number_fans = number_fans unless number_fans == SKIP
  @oc_device = oc_device unless oc_device == SKIP
  @oob_interface = oob_interface unless oob_interface == SKIP
  @packet_action_drop_only = packet_action_drop_only unless packet_action_drop_only == SKIP
  @pic = pic unless pic == SKIP
  @sub_required = sub_required unless sub_required == SKIP
  @type = 'switch'
  @additional_properties = additional_properties
end

Instance Attribute Details

#defaultsConstDeviceSwitchDefault

TODO: Write general description for this method



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

def defaults
  @defaults
end

#descriptionString

TODO: Write general description for this method

Returns:

  • (String)


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

def description
  @description
end

#displayString

TODO: Write general description for this method

Returns:

  • (String)


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

def display
  @display
end

#evolved_osTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def evolved_os
  @evolved_os
end

#evpn_ri_typeString

TODO: Write general description for this method

Returns:

  • (String)


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

def evpn_ri_type
  @evpn_ri_type
end

#experimentalTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def experimental
  @experimental
end

#fans_pluggableTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def fans_pluggable
  @fans_pluggable
end

#has_bgpTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def has_bgp
  @has_bgp
end

#has_etsTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def has_ets
  @has_ets
end

#has_evpnTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def has_evpn
  @has_evpn
end

#has_irbTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def has_irb
  @has_irb
end

#has_poe_outTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def has_poe_out
  @has_poe_out
end

#has_snapshotTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


66
67
68
# File 'lib/mist_api/models/const_device_switch.rb', line 66

def has_snapshot
  @has_snapshot
end

#has_vcTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


70
71
72
# File 'lib/mist_api/models/const_device_switch.rb', line 70

def has_vc
  @has_vc
end

#maliasString

TODO: Write general description for this method

Returns:

  • (String)


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

def malias
  @malias
end

#modelString

TODO: Write general description for this method

Returns:

  • (String)


74
75
76
# File 'lib/mist_api/models/const_device_switch.rb', line 74

def model
  @model
end

#modularTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


78
79
80
# File 'lib/mist_api/models/const_device_switch.rb', line 78

def modular
  @modular
end

#no_shaping_rateTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


82
83
84
# File 'lib/mist_api/models/const_device_switch.rb', line 82

def no_shaping_rate
  @no_shaping_rate
end

#number_fansInteger

TODO: Write general description for this method

Returns:

  • (Integer)


86
87
88
# File 'lib/mist_api/models/const_device_switch.rb', line 86

def number_fans
  @number_fans
end

#oc_deviceTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


90
91
92
# File 'lib/mist_api/models/const_device_switch.rb', line 90

def oc_device
  @oc_device
end

#oob_interfaceString

TODO: Write general description for this method

Returns:

  • (String)


94
95
96
# File 'lib/mist_api/models/const_device_switch.rb', line 94

def oob_interface
  @oob_interface
end

#packet_action_drop_onlyTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


98
99
100
# File 'lib/mist_api/models/const_device_switch.rb', line 98

def packet_action_drop_only
  @packet_action_drop_only
end

#picHash[String, String]

Object Key is the PIC number

Returns:

  • (Hash[String, String])


102
103
104
# File 'lib/mist_api/models/const_device_switch.rb', line 102

def pic
  @pic
end

#sub_requiredString

Object Key is the PIC number

Returns:

  • (String)


106
107
108
# File 'lib/mist_api/models/const_device_switch.rb', line 106

def sub_required
  @sub_required
end

#typeString (readonly)

Device Type. enum: ‘switch`

Returns:

  • (String)


110
111
112
# File 'lib/mist_api/models/const_device_switch.rb', line 110

def type
  @type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
# File 'lib/mist_api/models/const_device_switch.rb', line 220

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  malias = hash.key?('alias') ? hash['alias'] : SKIP
  defaults = ConstDeviceSwitchDefault.from_hash(hash['defaults']) if hash['defaults']
  description = hash.key?('description') ? hash['description'] : SKIP
  display = hash.key?('display') ? hash['display'] : SKIP
  evolved_os = hash['evolved_os'] ||= false
  evpn_ri_type = hash.key?('evpn_ri_type') ? hash['evpn_ri_type'] : SKIP
  experimental = hash['experimental'] ||= false
  fans_pluggable = hash['fans_pluggable'] ||= false
  has_bgp = hash['has_bgp'] ||= false
  has_ets = hash['has_ets'] ||= false
  has_evpn = hash['has_evpn'] ||= false
  has_irb = hash['has_irb'] ||= false
  has_poe_out = hash['has_poe_out'] ||= false
  has_snapshot = hash['has_snapshot'] ||= true
  has_vc = hash['has_vc'] ||= true
  model = hash.key?('model') ? hash['model'] : SKIP
  modular = hash['modular'] ||= false
  no_shaping_rate = hash['no_shaping_rate'] ||= false
  number_fans = hash.key?('number_fans') ? hash['number_fans'] : SKIP
  oc_device = hash['oc_device'] ||= false
  oob_interface = hash.key?('oob_interface') ? hash['oob_interface'] : SKIP
  packet_action_drop_only = hash['packet_action_drop_only'] ||= false
  pic = hash.key?('pic') ? hash['pic'] : SKIP
  sub_required = hash.key?('sub_required') ? hash['sub_required'] : SKIP

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  ConstDeviceSwitch.new(malias,
                        defaults,
                        description,
                        display,
                        evolved_os,
                        evpn_ri_type,
                        experimental,
                        fans_pluggable,
                        has_bgp,
                        has_ets,
                        has_evpn,
                        has_irb,
                        has_poe_out,
                        has_snapshot,
                        has_vc,
                        model,
                        modular,
                        no_shaping_rate,
                        number_fans,
                        oc_device,
                        oob_interface,
                        packet_action_drop_only,
                        pic,
                        sub_required,
                        additional_properties)
end

.namesObject

A mapping from model property names to API property names.



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/mist_api/models/const_device_switch.rb', line 113

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['malias'] = 'alias'
  @_hash['defaults'] = 'defaults'
  @_hash['description'] = 'description'
  @_hash['display'] = 'display'
  @_hash['evolved_os'] = 'evolved_os'
  @_hash['evpn_ri_type'] = 'evpn_ri_type'
  @_hash['experimental'] = 'experimental'
  @_hash['fans_pluggable'] = 'fans_pluggable'
  @_hash['has_bgp'] = 'has_bgp'
  @_hash['has_ets'] = 'has_ets'
  @_hash['has_evpn'] = 'has_evpn'
  @_hash['has_irb'] = 'has_irb'
  @_hash['has_poe_out'] = 'has_poe_out'
  @_hash['has_snapshot'] = 'has_snapshot'
  @_hash['has_vc'] = 'has_vc'
  @_hash['model'] = 'model'
  @_hash['modular'] = 'modular'
  @_hash['no_shaping_rate'] = 'no_shaping_rate'
  @_hash['number_fans'] = 'number_fans'
  @_hash['oc_device'] = 'oc_device'
  @_hash['oob_interface'] = 'oob_interface'
  @_hash['packet_action_drop_only'] = 'packet_action_drop_only'
  @_hash['pic'] = 'pic'
  @_hash['sub_required'] = 'sub_required'
  @_hash['type'] = 'type'
  @_hash
end

.nullablesObject

An array for nullable fields



174
175
176
# File 'lib/mist_api/models/const_device_switch.rb', line 174

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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
# File 'lib/mist_api/models/const_device_switch.rb', line 144

def self.optionals
  %w[
    malias
    defaults
    description
    display
    evolved_os
    evpn_ri_type
    experimental
    fans_pluggable
    has_bgp
    has_ets
    has_evpn
    has_irb
    has_poe_out
    has_snapshot
    has_vc
    model
    modular
    no_shaping_rate
    number_fans
    oc_device
    oob_interface
    packet_action_drop_only
    pic
    sub_required
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



286
287
288
289
290
291
292
293
294
295
296
# File 'lib/mist_api/models/const_device_switch.rb', line 286

def self.validate(value)
  if value.instance_of? self
    return APIHelper.valid_type?(value.type,
                                 ->(val) { val.instance_of? String })
  end

  return false unless value.instance_of? Hash

  APIHelper.valid_type?(value['type'],
                        ->(val) { val.instance_of? String })
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
# File 'lib/mist_api/models/const_device_switch.rb', line 313

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} malias: #{@malias.inspect}, defaults: #{@defaults.inspect}, description:"\
  " #{@description.inspect}, display: #{@display.inspect}, evolved_os: #{@evolved_os.inspect},"\
  " evpn_ri_type: #{@evpn_ri_type.inspect}, experimental: #{@experimental.inspect},"\
  " fans_pluggable: #{@fans_pluggable.inspect}, has_bgp: #{@has_bgp.inspect}, has_ets:"\
  " #{@has_ets.inspect}, has_evpn: #{@has_evpn.inspect}, has_irb: #{@has_irb.inspect},"\
  " has_poe_out: #{@has_poe_out.inspect}, has_snapshot: #{@has_snapshot.inspect}, has_vc:"\
  " #{@has_vc.inspect}, model: #{@model.inspect}, modular: #{@modular.inspect},"\
  " no_shaping_rate: #{@no_shaping_rate.inspect}, number_fans: #{@number_fans.inspect},"\
  " oc_device: #{@oc_device.inspect}, oob_interface: #{@oob_interface.inspect},"\
  " packet_action_drop_only: #{@packet_action_drop_only.inspect}, pic: #{@pic.inspect},"\
  " sub_required: #{@sub_required.inspect}, type: #{@type.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



299
300
301
302
303
304
305
306
307
308
309
310
# File 'lib/mist_api/models/const_device_switch.rb', line 299

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} malias: #{@malias}, defaults: #{@defaults}, description: #{@description},"\
  " display: #{@display}, evolved_os: #{@evolved_os}, evpn_ri_type: #{@evpn_ri_type},"\
  " experimental: #{@experimental}, fans_pluggable: #{@fans_pluggable}, has_bgp: #{@has_bgp},"\
  " has_ets: #{@has_ets}, has_evpn: #{@has_evpn}, has_irb: #{@has_irb}, has_poe_out:"\
  " #{@has_poe_out}, has_snapshot: #{@has_snapshot}, has_vc: #{@has_vc}, model: #{@model},"\
  " modular: #{@modular}, no_shaping_rate: #{@no_shaping_rate}, number_fans: #{@number_fans},"\
  " oc_device: #{@oc_device}, oob_interface: #{@oob_interface}, packet_action_drop_only:"\
  " #{@packet_action_drop_only}, pic: #{@pic}, sub_required: #{@sub_required}, type: #{@type},"\
  " additional_properties: #{@additional_properties}>"
end