Class: MistApi::DiscoveredSwitchMetricTypeEnum

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

Overview

enum: ‘inactive_wired_vlans`, `poe_compliance`, `switch_ap_affinity`, `version_compliance`

Constant Summary collapse

DISCOVERED_SWITCH_METRIC_TYPE_ENUM =
[
  # TODO: Write general description for INACTIVE_WIRED_VLANS
  INACTIVE_WIRED_VLANS = 'inactive_wired_vlans'.freeze,

  # TODO: Write general description for POE_COMPLIANCE
  POE_COMPLIANCE = 'poe_compliance'.freeze,

  # TODO: Write general description for SWITCH_AP_AFFINITY
  SWITCH_AP_AFFINITY = 'switch_ap_affinity'.freeze,

  # TODO: Write general description for VERSION_COMPLIANCE
  VERSION_COMPLIANCE = 'version_compliance'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = INACTIVE_WIRED_VLANS) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/mist_api/models/discovered_switch_metric_type_enum.rb', line 30

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

  str = value.to_s.strip

  case str.downcase
  when 'inactive_wired_vlans' then INACTIVE_WIRED_VLANS
  when 'poe_compliance' then POE_COMPLIANCE
  when 'switch_ap_affinity' then SWITCH_AP_AFFINITY
  when 'version_compliance' then VERSION_COMPLIANCE
  else
    default_value
  end
end

.validate(value) ⇒ Object



24
25
26
27
28
# File 'lib/mist_api/models/discovered_switch_metric_type_enum.rb', line 24

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

  DISCOVERED_SWITCH_METRIC_TYPE_ENUM.include?(value)
end