Class: MistApi::TunnelConfigTunnelModeEnum

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

Overview

Required if ‘provider`==`zscaler-gre`, `provider`==`jse-ipsec`. enum: `active-active`, `active-standby`

Constant Summary collapse

TUNNEL_CONFIG_TUNNEL_MODE_ENUM =
[
  # TODO: Write general description for ACTIVEACTIVE
  ACTIVEACTIVE = 'active-active'.freeze,

  # TODO: Write general description for ACTIVESTANDBY
  ACTIVESTANDBY = 'active-standby'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = ACTIVEACTIVE) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/mist_api/models/tunnel_config_tunnel_mode_enum.rb', line 24

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

  str = value.to_s.strip

  case str.downcase
  when 'activeactive' then ACTIVEACTIVE
  when 'activestandby' then ACTIVESTANDBY
  else
    default_value
  end
end

.validate(value) ⇒ Object



18
19
20
21
22
# File 'lib/mist_api/models/tunnel_config_tunnel_mode_enum.rb', line 18

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

  TUNNEL_CONFIG_TUNNEL_MODE_ENUM.include?(value)
end