Class: MistApi::ConstDeviceGateway

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

Overview

ConstDeviceGateway 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(defaults = SKIP, description = SKIP, experimental = false, fans_pluggable = true, ha_node0_fpc = SKIP, ha_node1_fpc = SKIP, has_bgp = false, has_fxp0 = true, has_ha_control = false, has_ha_data = false, has_irb = false, has_poe_out = true, has_snapshot = true, irb_disabled_by_default = false, model = SKIP, number_fans = SKIP, oc_device = false, pic = SKIP, ports = SKIP, sub_required = SKIP, t128_device = false) ⇒ ConstDeviceGateway

Returns a new instance of ConstDeviceGateway.



160
161
162
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
# File 'lib/mist_api/models/const_device_gateway.rb', line 160

def initialize(defaults = SKIP, description = SKIP, experimental = false,
               fans_pluggable = true, ha_node0_fpc = SKIP,
               ha_node1_fpc = SKIP, has_bgp = false, has_fxp0 = true,
               has_ha_control = false, has_ha_data = false, has_irb = false,
               has_poe_out = true, has_snapshot = true,
               irb_disabled_by_default = false, model = SKIP,
               number_fans = SKIP, oc_device = false, pic = SKIP,
               ports = SKIP, sub_required = SKIP, t128_device = false)
  @defaults = defaults unless defaults == SKIP
  @description = description unless description == SKIP
  @experimental = experimental unless experimental == SKIP
  @fans_pluggable = fans_pluggable unless fans_pluggable == SKIP
  @ha_node0_fpc = ha_node0_fpc unless ha_node0_fpc == SKIP
  @ha_node1_fpc = ha_node1_fpc unless ha_node1_fpc == SKIP
  @has_bgp = has_bgp unless has_bgp == SKIP
  @has_fxp0 = has_fxp0 unless has_fxp0 == SKIP
  @has_ha_control = has_ha_control unless has_ha_control == SKIP
  @has_ha_data = has_ha_data unless has_ha_data == 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
  @irb_disabled_by_default = irb_disabled_by_default unless irb_disabled_by_default == SKIP
  @model = model unless model == SKIP
  @number_fans = number_fans unless number_fans == SKIP
  @oc_device = oc_device unless oc_device == SKIP
  @pic = pic unless pic == SKIP
  @ports = ports unless ports == SKIP
  @sub_required = sub_required unless sub_required == SKIP
  @t128_device = t128_device unless t128_device == SKIP
  @type = 'gateway'
end

Instance Attribute Details

#defaultsHash[String, String]

Object Key is the interface type name (e.g. “lan_ports”, “wan_ports”, …)

Returns:

  • (Hash[String, String])


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

def defaults
  @defaults
end

#descriptionString

Object Key is the interface type name (e.g. “lan_ports”, “wan_ports”, …)

Returns:

  • (String)


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

def description
  @description
end

#experimentalTrueClass | FalseClass

Object Key is the interface type name (e.g. “lan_ports”, “wan_ports”, …)

Returns:

  • (TrueClass | FalseClass)


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

def experimental
  @experimental
end

#fans_pluggableTrueClass | FalseClass

Object Key is the interface type name (e.g. “lan_ports”, “wan_ports”, …)

Returns:

  • (TrueClass | FalseClass)


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

def fans_pluggable
  @fans_pluggable
end

#ha_node0_fpcInteger

Object Key is the interface type name (e.g. “lan_ports”, “wan_ports”, …)

Returns:

  • (Integer)


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

def ha_node0_fpc
  @ha_node0_fpc
end

#ha_node1_fpcInteger

Object Key is the interface type name (e.g. “lan_ports”, “wan_ports”, …)

Returns:

  • (Integer)


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

def ha_node1_fpc
  @ha_node1_fpc
end

#has_bgpTrueClass | FalseClass

Object Key is the interface type name (e.g. “lan_ports”, “wan_ports”, …)

Returns:

  • (TrueClass | FalseClass)


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

def has_bgp
  @has_bgp
end

#has_fxp0TrueClass | FalseClass

Object Key is the interface type name (e.g. “lan_ports”, “wan_ports”, …)

Returns:

  • (TrueClass | FalseClass)


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

def has_fxp0
  @has_fxp0
end

#has_ha_controlTrueClass | FalseClass

Object Key is the interface type name (e.g. “lan_ports”, “wan_ports”, …)

Returns:

  • (TrueClass | FalseClass)


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

def has_ha_control
  @has_ha_control
end

#has_ha_dataTrueClass | FalseClass

Object Key is the interface type name (e.g. “lan_ports”, “wan_ports”, …)

Returns:

  • (TrueClass | FalseClass)


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

def has_ha_data
  @has_ha_data
end

#has_irbTrueClass | FalseClass

Object Key is the interface type name (e.g. “lan_ports”, “wan_ports”, …)

Returns:

  • (TrueClass | FalseClass)


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

def has_irb
  @has_irb
end

#has_poe_outTrueClass | FalseClass

Object Key is the interface type name (e.g. “lan_ports”, “wan_ports”, …)

Returns:

  • (TrueClass | FalseClass)


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

def has_poe_out
  @has_poe_out
end

#has_snapshotTrueClass | FalseClass

Object Key is the interface type name (e.g. “lan_ports”, “wan_ports”, …)

Returns:

  • (TrueClass | FalseClass)


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

def has_snapshot
  @has_snapshot
end

#irb_disabled_by_defaultTrueClass | FalseClass

Object Key is the interface type name (e.g. “lan_ports”, “wan_ports”, …)

Returns:

  • (TrueClass | FalseClass)


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

def irb_disabled_by_default
  @irb_disabled_by_default
end

#modelString

Object Key is the interface type name (e.g. “lan_ports”, “wan_ports”, …)

Returns:

  • (String)


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

def model
  @model
end

#number_fansInteger

Object Key is the interface type name (e.g. “lan_ports”, “wan_ports”, …)

Returns:

  • (Integer)


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

def number_fans
  @number_fans
end

#oc_deviceTrueClass | FalseClass

Object Key is the interface type name (e.g. “lan_ports”, “wan_ports”, …)

Returns:

  • (TrueClass | FalseClass)


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

def oc_device
  @oc_device
end

#picHash[String, String]

Object Key is the PIC number

Returns:

  • (Hash[String, String])


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

def pic
  @pic
end

#portsConstDeviceGatewayPorts

Object Key is the interface name (e.g. “ge-0/0/1”, …)



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

def ports
  @ports
end

#sub_requiredString

Object Key is the interface name (e.g. “ge-0/0/1”, …)

Returns:

  • (String)


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

def sub_required
  @sub_required
end

#t128_deviceTrueClass | FalseClass

Object Key is the interface name (e.g. “ge-0/0/1”, …)

Returns:

  • (TrueClass | FalseClass)


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

def t128_device
  @t128_device
end

#typeString (readonly)

Device Type. enum: ‘gateway`

Returns:

  • (String)


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

def type
  @type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
# File 'lib/mist_api/models/const_device_gateway.rb', line 193

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  defaults = hash.key?('defaults') ? hash['defaults'] : SKIP
  description = hash.key?('description') ? hash['description'] : SKIP
  experimental = hash['experimental'] ||= false
  fans_pluggable = hash['fans_pluggable'] ||= true
  ha_node0_fpc = hash.key?('ha_node0_fpc') ? hash['ha_node0_fpc'] : SKIP
  ha_node1_fpc = hash.key?('ha_node1_fpc') ? hash['ha_node1_fpc'] : SKIP
  has_bgp = hash['has_bgp'] ||= false
  has_fxp0 = hash['has_fxp0'] ||= true
  has_ha_control = hash['has_ha_control'] ||= false
  has_ha_data = hash['has_ha_data'] ||= false
  has_irb = hash['has_irb'] ||= false
  has_poe_out = hash['has_poe_out'] ||= true
  has_snapshot = hash['has_snapshot'] ||= true
  irb_disabled_by_default = hash['irb_disabled_by_default'] ||= false
  model = hash.key?('model') ? hash['model'] : SKIP
  number_fans = hash.key?('number_fans') ? hash['number_fans'] : SKIP
  oc_device = hash['oc_device'] ||= false
  pic = hash.key?('pic') ? hash['pic'] : SKIP
  ports = ConstDeviceGatewayPorts.from_hash(hash['ports']) if hash['ports']
  sub_required = hash.key?('sub_required') ? hash['sub_required'] : SKIP
  t128_device = hash['t128_device'] ||= false

  # Create object from extracted values.
  ConstDeviceGateway.new(defaults,
                         description,
                         experimental,
                         fans_pluggable,
                         ha_node0_fpc,
                         ha_node1_fpc,
                         has_bgp,
                         has_fxp0,
                         has_ha_control,
                         has_ha_data,
                         has_irb,
                         has_poe_out,
                         has_snapshot,
                         irb_disabled_by_default,
                         model,
                         number_fans,
                         oc_device,
                         pic,
                         ports,
                         sub_required,
                         t128_device)
end

.namesObject

A mapping from model property names to API property names.



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/mist_api/models/const_device_gateway.rb', line 101

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['defaults'] = 'defaults'
  @_hash['description'] = 'description'
  @_hash['experimental'] = 'experimental'
  @_hash['fans_pluggable'] = 'fans_pluggable'
  @_hash['ha_node0_fpc'] = 'ha_node0_fpc'
  @_hash['ha_node1_fpc'] = 'ha_node1_fpc'
  @_hash['has_bgp'] = 'has_bgp'
  @_hash['has_fxp0'] = 'has_fxp0'
  @_hash['has_ha_control'] = 'has_ha_control'
  @_hash['has_ha_data'] = 'has_ha_data'
  @_hash['has_irb'] = 'has_irb'
  @_hash['has_poe_out'] = 'has_poe_out'
  @_hash['has_snapshot'] = 'has_snapshot'
  @_hash['irb_disabled_by_default'] = 'irb_disabled_by_default'
  @_hash['model'] = 'model'
  @_hash['number_fans'] = 'number_fans'
  @_hash['oc_device'] = 'oc_device'
  @_hash['pic'] = 'pic'
  @_hash['ports'] = 'ports'
  @_hash['sub_required'] = 'sub_required'
  @_hash['t128_device'] = 't128_device'
  @_hash['type'] = 'type'
  @_hash
end

.nullablesObject

An array for nullable fields



156
157
158
# File 'lib/mist_api/models/const_device_gateway.rb', line 156

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    defaults
    description
    experimental
    fans_pluggable
    ha_node0_fpc
    ha_node1_fpc
    has_bgp
    has_fxp0
    has_ha_control
    has_ha_data
    has_irb
    has_poe_out
    has_snapshot
    irb_disabled_by_default
    model
    number_fans
    oc_device
    pic
    ports
    sub_required
    t128_device
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



245
246
247
248
249
250
251
252
253
254
255
# File 'lib/mist_api/models/const_device_gateway.rb', line 245

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.



271
272
273
274
275
276
277
278
279
280
281
282
283
# File 'lib/mist_api/models/const_device_gateway.rb', line 271

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} defaults: #{@defaults.inspect}, description: #{@description.inspect},"\
  " experimental: #{@experimental.inspect}, fans_pluggable: #{@fans_pluggable.inspect},"\
  " ha_node0_fpc: #{@ha_node0_fpc.inspect}, ha_node1_fpc: #{@ha_node1_fpc.inspect}, has_bgp:"\
  " #{@has_bgp.inspect}, has_fxp0: #{@has_fxp0.inspect}, has_ha_control:"\
  " #{@has_ha_control.inspect}, has_ha_data: #{@has_ha_data.inspect}, has_irb:"\
  " #{@has_irb.inspect}, has_poe_out: #{@has_poe_out.inspect}, has_snapshot:"\
  " #{@has_snapshot.inspect}, irb_disabled_by_default: #{@irb_disabled_by_default.inspect},"\
  " model: #{@model.inspect}, number_fans: #{@number_fans.inspect}, oc_device:"\
  " #{@oc_device.inspect}, pic: #{@pic.inspect}, ports: #{@ports.inspect}, sub_required:"\
  " #{@sub_required.inspect}, t128_device: #{@t128_device.inspect}, type: #{@type.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



258
259
260
261
262
263
264
265
266
267
268
# File 'lib/mist_api/models/const_device_gateway.rb', line 258

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} defaults: #{@defaults}, description: #{@description}, experimental:"\
  " #{@experimental}, fans_pluggable: #{@fans_pluggable}, ha_node0_fpc: #{@ha_node0_fpc},"\
  " ha_node1_fpc: #{@ha_node1_fpc}, has_bgp: #{@has_bgp}, has_fxp0: #{@has_fxp0},"\
  " has_ha_control: #{@has_ha_control}, has_ha_data: #{@has_ha_data}, has_irb: #{@has_irb},"\
  " has_poe_out: #{@has_poe_out}, has_snapshot: #{@has_snapshot}, irb_disabled_by_default:"\
  " #{@irb_disabled_by_default}, model: #{@model}, number_fans: #{@number_fans}, oc_device:"\
  " #{@oc_device}, pic: #{@pic}, ports: #{@ports}, sub_required: #{@sub_required},"\
  " t128_device: #{@t128_device}, type: #{@type}>"
end