Class: MistApi::GatewayPortVpnPathRoleEnum

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

Overview

If the VPN ‘type`==`hub_spoke`, enum: `hub`, `spoke`. If the VPN `type`==`mesh`, enum: `mesh`

Constant Summary collapse

GATEWAY_PORT_VPN_PATH_ROLE_ENUM =
[
  # TODO: Write general description for HUB
  HUB = 'hub'.freeze,

  # TODO: Write general description for MESH
  MESH = 'mesh'.freeze,

  # TODO: Write general description for SPOKE
  SPOKE = 'spoke'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = HUB) ⇒ Object



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

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

  str = value.to_s.strip

  case str.downcase
  when 'hub' then HUB
  when 'mesh' then MESH
  when 'spoke' then SPOKE
  else
    default_value
  end
end

.validate(value) ⇒ Object



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

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

  GATEWAY_PORT_VPN_PATH_ROLE_ENUM.include?(value)
end