Class: MistApi::GatewayPortConfigWanSpeedtestModeEnum

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

Overview

Controls whether Marvis/scheduler can run speedtest on this port. enum: ‘auto`, `enabled`, `disabled`

Constant Summary collapse

GATEWAY_PORT_CONFIG_WAN_SPEEDTEST_MODE_ENUM =
[
  # TODO: Write general description for AUTO
  AUTO = 'auto'.freeze,

  # TODO: Write general description for ENABLED
  ENABLED = 'enabled'.freeze,

  # TODO: Write general description for DISABLED
  DISABLED = 'disabled'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = AUTO) ⇒ Object



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

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

  str = value.to_s.strip

  case str.downcase
  when 'auto' then AUTO
  when 'enabled' then ENABLED
  when 'disabled' then DISABLED
  else
    default_value
  end
end

.validate(value) ⇒ Object



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

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

  GATEWAY_PORT_CONFIG_WAN_SPEEDTEST_MODE_ENUM.include?(value)
end