Class: MistApi::SiteAppsCountDistinctEnum

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

Overview

enum: ‘ap`, `app`, `category`, `device_mac`, `port_id`, `service`, `src_ip`, `ssid`, `wcid`, `wlan_id app`

Constant Summary collapse

SITE_APPS_COUNT_DISTINCT_ENUM =
[
  # TODO: Write general description for AP
  AP = 'ap'.freeze,

  # TODO: Write general description for APP
  APP = 'app'.freeze,

  # TODO: Write general description for CATEGORY
  CATEGORY = 'category'.freeze,

  # TODO: Write general description for DEVICE_MAC
  DEVICE_MAC = 'device_mac'.freeze,

  # TODO: Write general description for PORT_ID
  PORT_ID = 'port_id'.freeze,

  # TODO: Write general description for SERVICE
  SERVICE = 'service'.freeze,

  # TODO: Write general description for SRC_IP
  SRC_IP = 'src_ip'.freeze,

  # TODO: Write general description for SSID
  SSID = 'ssid'.freeze,

  # TODO: Write general description for WCID
  WCID = 'wcid'.freeze,

  # TODO: Write general description for ENUM_WLAN_ID_APP
  ENUM_WLAN_ID_APP = 'wlan_id app'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = AP) ⇒ Object



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/mist_api/models/site_apps_count_distinct_enum.rb', line 48

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

  str = value.to_s.strip

  case str.downcase
  when 'ap' then AP
  when 'app' then APP
  when 'category' then CATEGORY
  when 'device_mac' then DEVICE_MAC
  when 'port_id' then PORT_ID
  when 'service' then SERVICE
  when 'src_ip' then SRC_IP
  when 'ssid' then SSID
  when 'wcid' then WCID
  when 'enum_wlan_id_app' then ENUM_WLAN_ID_APP
  else
    default_value
  end
end

.validate(value) ⇒ Object



42
43
44
45
46
# File 'lib/mist_api/models/site_apps_count_distinct_enum.rb', line 42

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

  SITE_APPS_COUNT_DISTINCT_ENUM.include?(value)
end