Class: MistApi::ApUsb

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

Overview

USB AP settings - Note: if native imagotag is enabled, BLE will be disabled automatically - Note: legacy, new config moved to ESL Config.

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(cacert = SKIP, channel = SKIP, enabled = SKIP, host = SKIP, port = 0, type = SKIP, verify_cert = SKIP, vlan_id = 1) ⇒ ApUsb

Returns a new instance of ApUsb.



81
82
83
84
85
86
87
88
89
90
91
# File 'lib/mist_api/models/ap_usb.rb', line 81

def initialize(cacert = SKIP, channel = SKIP, enabled = SKIP, host = SKIP,
               port = 0, type = SKIP, verify_cert = SKIP, vlan_id = 1)
  @cacert = cacert unless cacert == SKIP
  @channel = channel unless channel == SKIP
  @enabled = enabled unless enabled == SKIP
  @host = host unless host == SKIP
  @port = port unless port == SKIP
  @type = type unless type == SKIP
  @verify_cert = verify_cert unless verify_cert == SKIP
  @vlan_id = vlan_id unless vlan_id == SKIP
end

Instance Attribute Details

#cacertString

Only if ‘type`==`imagotag`

Returns:

  • (String)


15
16
17
# File 'lib/mist_api/models/ap_usb.rb', line 15

def cacert
  @cacert
end

#channelInteger

Only if ‘type`==`imagotag`, channel selection, not needed by default, required for manual channel override only

Returns:

  • (Integer)


20
21
22
# File 'lib/mist_api/models/ap_usb.rb', line 20

def channel
  @channel
end

#enabledTrueClass | FalseClass

Whether to enable any usb config

Returns:

  • (TrueClass | FalseClass)


24
25
26
# File 'lib/mist_api/models/ap_usb.rb', line 24

def enabled
  @enabled
end

#hostString

Only if ‘type`==`imagotag`

Returns:

  • (String)


28
29
30
# File 'lib/mist_api/models/ap_usb.rb', line 28

def host
  @host
end

#portInteger

Only if ‘type`==`imagotag`

Returns:

  • (Integer)


32
33
34
# File 'lib/mist_api/models/ap_usb.rb', line 32

def port
  @port
end

#typeApUsbTypeEnum

usb config type. enum: ‘hanshow`, `imagotag`, `solum`

Returns:



36
37
38
# File 'lib/mist_api/models/ap_usb.rb', line 36

def type
  @type
end

#verify_certTrueClass | FalseClass

Only if ‘type`==`imagotag`, whether to turn on SSL verification

Returns:

  • (TrueClass | FalseClass)


40
41
42
# File 'lib/mist_api/models/ap_usb.rb', line 40

def verify_cert
  @verify_cert
end

#vlan_idInteger

Only if ‘type`==`solum` or `type`==`hanshow`

Returns:

  • (Integer)


44
45
46
# File 'lib/mist_api/models/ap_usb.rb', line 44

def vlan_id
  @vlan_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/mist_api/models/ap_usb.rb', line 94

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  cacert = hash.key?('cacert') ? hash['cacert'] : SKIP
  channel = hash.key?('channel') ? hash['channel'] : SKIP
  enabled = hash.key?('enabled') ? hash['enabled'] : SKIP
  host = hash.key?('host') ? hash['host'] : SKIP
  port = hash['port'] ||= 0
  type = hash.key?('type') ? hash['type'] : SKIP
  verify_cert = hash.key?('verify_cert') ? hash['verify_cert'] : SKIP
  vlan_id = hash['vlan_id'] ||= 1

  # Create object from extracted values.
  ApUsb.new(cacert,
            channel,
            enabled,
            host,
            port,
            type,
            verify_cert,
            vlan_id)
end

.namesObject

A mapping from model property names to API property names.



47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/mist_api/models/ap_usb.rb', line 47

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['cacert'] = 'cacert'
  @_hash['channel'] = 'channel'
  @_hash['enabled'] = 'enabled'
  @_hash['host'] = 'host'
  @_hash['port'] = 'port'
  @_hash['type'] = 'type'
  @_hash['verify_cert'] = 'verify_cert'
  @_hash['vlan_id'] = 'vlan_id'
  @_hash
end

.nullablesObject

An array for nullable fields



75
76
77
78
79
# File 'lib/mist_api/models/ap_usb.rb', line 75

def self.nullables
  %w[
    cacert
  ]
end

.optionalsObject

An array for optional fields



61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/mist_api/models/ap_usb.rb', line 61

def self.optionals
  %w[
    cacert
    channel
    enabled
    host
    port
    type
    verify_cert
    vlan_id
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



127
128
129
130
131
132
# File 'lib/mist_api/models/ap_usb.rb', line 127

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} cacert: #{@cacert.inspect}, channel: #{@channel.inspect}, enabled:"\
  " #{@enabled.inspect}, host: #{@host.inspect}, port: #{@port.inspect}, type:"\
  " #{@type.inspect}, verify_cert: #{@verify_cert.inspect}, vlan_id: #{@vlan_id.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



119
120
121
122
123
124
# File 'lib/mist_api/models/ap_usb.rb', line 119

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} cacert: #{@cacert}, channel: #{@channel}, enabled: #{@enabled}, host:"\
  " #{@host}, port: #{@port}, type: #{@type}, verify_cert: #{@verify_cert}, vlan_id:"\
  " #{@vlan_id}>"
end