Class: MistApi::SwRoutingPolicyTermMatchingProtocolEnum

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

Overview

enum: ‘bgp`, `direct`, `evpn`, `ospf`, `static`

Constant Summary collapse

SW_ROUTING_POLICY_TERM_MATCHING_PROTOCOL_ENUM =
[
  # TODO: Write general description for BGP
  BGP = 'bgp'.freeze,

  # TODO: Write general description for DIRECT
  DIRECT = 'direct'.freeze,

  # TODO: Write general description for EVPN
  EVPN = 'evpn'.freeze,

  # TODO: Write general description for OSPF
  OSPF = 'ospf'.freeze,

  # TODO: Write general description for STATIC
  STATIC = 'static'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = BGP) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/mist_api/models/sw_routing_policy_term_matching_protocol_enum.rb', line 32

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

  str = value.to_s.strip

  case str.downcase
  when 'bgp' then BGP
  when 'direct' then DIRECT
  when 'evpn' then EVPN
  when 'ospf' then OSPF
  when 'static' then STATIC
  else
    default_value
  end
end

.validate(value) ⇒ Object



26
27
28
29
30
# File 'lib/mist_api/models/sw_routing_policy_term_matching_protocol_enum.rb', line 26

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

  SW_ROUTING_POLICY_TERM_MATCHING_PROTOCOL_ENUM.include?(value)
end