Class: MistApi::SwitchPortUsageDynamicResetDefaultWhenEnum
- Inherits:
-
Object
- Object
- MistApi::SwitchPortUsageDynamicResetDefaultWhenEnum
- Defined in:
- lib/mist_api/models/switch_port_usage_dynamic_reset_default_when_enum.rb
Overview
Only if ‘mode`==`dynamic` Control when the DPC port should be changed to the default port usage. enum: `link_down`, `none` (let the DPC port keep at the current port usage)
Constant Summary collapse
- SWITCH_PORT_USAGE_DYNAMIC_RESET_DEFAULT_WHEN_ENUM =
[ # TODO: Write general description for LINK_DOWN LINK_DOWN = 'link_down'.freeze, # TODO: Write general description for NONE NONE = 'none'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = LINK_DOWN) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/mist_api/models/switch_port_usage_dynamic_reset_default_when_enum.rb', line 25 def self.from_value(value, default_value = LINK_DOWN) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'link_down' then LINK_DOWN when 'none' then NONE else default_value end end |
.validate(value) ⇒ Object
19 20 21 22 23 |
# File 'lib/mist_api/models/switch_port_usage_dynamic_reset_default_when_enum.rb', line 19 def self.validate(value) return false if value.nil? SWITCH_PORT_USAGE_DYNAMIC_RESET_DEFAULT_WHEN_ENUM.include?(value) end |