Class: MistApi::WanUsagesCountDistinctEnum
- Inherits:
-
Object
- Object
- MistApi::WanUsagesCountDistinctEnum
- Defined in:
- lib/mist_api/models/wan_usages_count_distinct_enum.rb
Overview
enum: ‘mac`, `path_type`, `peer_mac`, `peer_port_id`, `policy`, `port_id`, `tenant`
Constant Summary collapse
- WAN_USAGES_COUNT_DISTINCT_ENUM =
[ # TODO: Write general description for MAC MAC = 'mac'.freeze, # TODO: Write general description for PATH_TYPE PATH_TYPE = 'path_type'.freeze, # TODO: Write general description for PEER_MAC PEER_MAC = 'peer_mac'.freeze, # TODO: Write general description for PEER_PORT_ID PEER_PORT_ID = 'peer_port_id'.freeze, # TODO: Write general description for POLICY POLICY = 'policy'.freeze, # TODO: Write general description for PORT_ID PORT_ID = 'port_id'.freeze, # TODO: Write general description for TENANT TENANT = 'tenant'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = MAC) ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/mist_api/models/wan_usages_count_distinct_enum.rb', line 39 def self.from_value(value, default_value = MAC) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'mac' then MAC when 'path_type' then PATH_TYPE when 'peer_mac' then PEER_MAC when 'peer_port_id' then PEER_PORT_ID when 'policy' then POLICY when 'port_id' then PORT_ID when 'tenant' then TENANT else default_value end end |
.validate(value) ⇒ Object
33 34 35 36 37 |
# File 'lib/mist_api/models/wan_usages_count_distinct_enum.rb', line 33 def self.validate(value) return false if value.nil? WAN_USAGES_COUNT_DISTINCT_ENUM.include?(value) end |