Class: MistApi::CaptureMxedgeFormatEnum

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

Overview

PCAP format. enum: * ‘stream`: to Mist cloud * `tzsp`: stream packets (over UDP as TZSP packets) to a remote host (typically running Wireshark)

Constant Summary collapse

CAPTURE_MXEDGE_FORMAT_ENUM =
[
  # TODO: Write general description for STREAM
  STREAM = 'stream'.freeze,

  # TODO: Write general description for TZSP
  TZSP = 'tzsp'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = STREAM) ⇒ Object



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

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

  str = value.to_s.strip

  case str.downcase
  when 'stream' then STREAM
  when 'tzsp' then TZSP
  else
    default_value
  end
end

.validate(value) ⇒ Object



19
20
21
22
23
# File 'lib/mist_api/models/capture_mxedge_format_enum.rb', line 19

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

  CAPTURE_MXEDGE_FORMAT_ENUM.include?(value)
end