Class: MistApi::ApEslConfig

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

Overview

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

Returns a new instance of ApEslConfig.



78
79
80
81
82
83
84
85
86
87
88
# File 'lib/mist_api/models/ap_esl_config.rb', line 78

def initialize(cacert = SKIP, channel = SKIP, enabled = false, host = SKIP,
               port = SKIP, 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` or `type`==`native`

Returns:

  • (String)


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

def cacert
  @cacert
end

#channelInteger

Only if ‘type`==`imagotag` or `type`==`native`

Returns:

  • (Integer)


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

def channel
  @channel
end

#enabledTrueClass | FalseClass

usb_config is ignored if esl_config enabled

Returns:

  • (TrueClass | FalseClass)


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

def enabled
  @enabled
end

#hostString

Only if ‘type`==`imagotag` or `type`==`native`

Returns:

  • (String)


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

def host
  @host
end

#portInteger

Only if ‘type`==`imagotag` or `type`==`native`

Returns:

  • (Integer)


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

def port
  @port
end

#typeApEslTypeEnum

note: ble_config will be ignored if esl_config is enabled and with native mode. enum: ‘hanshow`, `imagotag`, `native`, `solum`

Returns:



35
36
37
# File 'lib/mist_api/models/ap_esl_config.rb', line 35

def type
  @type
end

#verify_certTrueClass | FalseClass

Only if ‘type`==`imagotag` or `type`==`native`

Returns:

  • (TrueClass | FalseClass)


39
40
41
# File 'lib/mist_api/models/ap_esl_config.rb', line 39

def verify_cert
  @verify_cert
end

#vlan_idInteger

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

Returns:

  • (Integer)


43
44
45
# File 'lib/mist_api/models/ap_esl_config.rb', line 43

def vlan_id
  @vlan_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/mist_api/models/ap_esl_config.rb', line 91

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['enabled'] ||= false
  host = hash.key?('host') ? hash['host'] : SKIP
  port = hash.key?('port') ? hash['port'] : SKIP
  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.
  ApEslConfig.new(cacert,
                  channel,
                  enabled,
                  host,
                  port,
                  type,
                  verify_cert,
                  vlan_id)
end

.namesObject

A mapping from model property names to API property names.



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

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



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

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.



124
125
126
127
128
129
# File 'lib/mist_api/models/ap_esl_config.rb', line 124

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.



116
117
118
119
120
121
# File 'lib/mist_api/models/ap_esl_config.rb', line 116

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