Class: MistApi::SwitchPortLocalUsageMacAuthProtocolEnum

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

Overview

Only if ‘enable_mac_auth` ==`true`. This type is ignored if mist_nac is enabled. enum: `eap-md5`, `eap-peap`, `pap`

Constant Summary collapse

SWITCH_PORT_LOCAL_USAGE_MAC_AUTH_PROTOCOL_ENUM =
[
  # TODO: Write general description for EAPMD5
  EAPMD5 = 'eap-md5'.freeze,

  # TODO: Write general description for EAPPEAP
  EAPPEAP = 'eap-peap'.freeze,

  # TODO: Write general description for PAP
  PAP = 'pap'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = EAPMD5) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/mist_api/models/switch_port_local_usage_mac_auth_protocol_enum.rb', line 27

def self.from_value(value, default_value = EAPMD5)
  return default_value if value.nil?

  str = value.to_s.strip

  case str.downcase
  when 'eapmd5' then EAPMD5
  when 'eappeap' then EAPPEAP
  when 'pap' then PAP
  else
    default_value
  end
end

.validate(value) ⇒ Object



21
22
23
24
25
# File 'lib/mist_api/models/switch_port_local_usage_mac_auth_protocol_enum.rb', line 21

def self.validate(value)
  return false if value.nil?

  SWITCH_PORT_LOCAL_USAGE_MAC_AUTH_PROTOCOL_ENUM.include?(value)
end