Class: MistApi::CaptureWireless
- Defined in:
- lib/mist_api/models/capture_wireless.rb
Overview
Initiate a Wireless Packet Capture
Instance Attribute Summary collapse
-
#ap_mac ⇒ String
TODO: Write general description for this method.
-
#band ⇒ CaptureWirelessBandEnum
enum: ‘24`, `5`, `6`.
-
#duration ⇒ Integer
Duration of the capture, in seconds.
-
#format ⇒ CaptureWirelessFormatEnum
pcap format.
-
#max_pkt_len ⇒ Integer
pcap format.
-
#num_packets ⇒ Integer
number of packets to capture, 0 for unlimited, default is 1024, maximum is 10000.
-
#ssid ⇒ String
number of packets to capture, 0 for unlimited, default is 1024, maximum is 10000.
-
#type ⇒ String
readonly
enum: ‘wireless`.
-
#wlan_id ⇒ UUID | String
WLAN ID.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(ap_mac = SKIP, band = CaptureWirelessBandEnum::ENUM_24, duration = 600, format = CaptureWirelessFormatEnum::PCAP, max_pkt_len = 512, num_packets = 1024, ssid = SKIP, wlan_id = SKIP, additional_properties = nil) ⇒ CaptureWireless
constructor
A new instance of CaptureWireless.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(ap_mac = SKIP, band = CaptureWirelessBandEnum::ENUM_24, duration = 600, format = CaptureWirelessFormatEnum::PCAP, max_pkt_len = 512, num_packets = 1024, ssid = SKIP, wlan_id = SKIP, additional_properties = nil) ⇒ CaptureWireless
Returns a new instance of CaptureWireless.
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/mist_api/models/capture_wireless.rb', line 89 def initialize(ap_mac = SKIP, band = CaptureWirelessBandEnum::ENUM_24, duration = 600, format = CaptureWirelessFormatEnum::PCAP, max_pkt_len = 512, num_packets = 1024, ssid = SKIP, wlan_id = SKIP, additional_properties = nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @ap_mac = ap_mac unless ap_mac == SKIP @band = band unless band == SKIP @duration = duration unless duration == SKIP @format = format unless format == SKIP @max_pkt_len = max_pkt_len unless max_pkt_len == SKIP @num_packets = num_packets unless num_packets == SKIP @ssid = ssid unless ssid == SKIP @type = 'wireless' @wlan_id = wlan_id unless wlan_id == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#ap_mac ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/mist_api/models/capture_wireless.rb', line 14 def ap_mac @ap_mac end |
#band ⇒ CaptureWirelessBandEnum
enum: ‘24`, `5`, `6`
18 19 20 |
# File 'lib/mist_api/models/capture_wireless.rb', line 18 def band @band end |
#duration ⇒ Integer
Duration of the capture, in seconds
22 23 24 |
# File 'lib/mist_api/models/capture_wireless.rb', line 22 def duration @duration end |
#format ⇒ CaptureWirelessFormatEnum
pcap format. enum: ‘pcap`, `stream`
26 27 28 |
# File 'lib/mist_api/models/capture_wireless.rb', line 26 def format @format end |
#max_pkt_len ⇒ Integer
pcap format. enum: ‘pcap`, `stream`
30 31 32 |
# File 'lib/mist_api/models/capture_wireless.rb', line 30 def max_pkt_len @max_pkt_len end |
#num_packets ⇒ Integer
number of packets to capture, 0 for unlimited, default is 1024, maximum is 10000
35 36 37 |
# File 'lib/mist_api/models/capture_wireless.rb', line 35 def num_packets @num_packets end |
#ssid ⇒ String
number of packets to capture, 0 for unlimited, default is 1024, maximum is 10000
40 41 42 |
# File 'lib/mist_api/models/capture_wireless.rb', line 40 def ssid @ssid end |
#type ⇒ String (readonly)
enum: ‘wireless`
44 45 46 |
# File 'lib/mist_api/models/capture_wireless.rb', line 44 def type @type end |
#wlan_id ⇒ UUID | String
WLAN ID
48 49 50 |
# File 'lib/mist_api/models/capture_wireless.rb', line 48 def wlan_id @wlan_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/mist_api/models/capture_wireless.rb', line 109 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. ap_mac = hash.key?('ap_mac') ? hash['ap_mac'] : SKIP band = hash['band'] ||= CaptureWirelessBandEnum::ENUM_24 duration = hash['duration'] ||= 600 format = hash['format'] ||= CaptureWirelessFormatEnum::PCAP max_pkt_len = hash['max_pkt_len'] ||= 512 num_packets = hash['num_packets'] ||= 1024 ssid = hash.key?('ssid') ? hash['ssid'] : SKIP wlan_id = hash.key?('wlan_id') ? hash['wlan_id'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. CaptureWireless.new(ap_mac, band, duration, format, max_pkt_len, num_packets, ssid, wlan_id, additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/mist_api/models/capture_wireless.rb', line 51 def self.names @_hash = {} if @_hash.nil? @_hash['ap_mac'] = 'ap_mac' @_hash['band'] = 'band' @_hash['duration'] = 'duration' @_hash['format'] = 'format' @_hash['max_pkt_len'] = 'max_pkt_len' @_hash['num_packets'] = 'num_packets' @_hash['ssid'] = 'ssid' @_hash['type'] = 'type' @_hash['wlan_id'] = 'wlan_id' @_hash end |
.nullables ⇒ Object
An array for nullable fields
80 81 82 83 84 85 86 87 |
# File 'lib/mist_api/models/capture_wireless.rb', line 80 def self.nullables %w[ ap_mac duration max_pkt_len num_packets ] end |
.optionals ⇒ Object
An array for optional fields
66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/mist_api/models/capture_wireless.rb', line 66 def self.optionals %w[ ap_mac band duration format max_pkt_len num_packets ssid wlan_id ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
150 151 152 153 154 155 156 |
# File 'lib/mist_api/models/capture_wireless.rb', line 150 def inspect class_name = self.class.name.split('::').last "<#{class_name} ap_mac: #{@ap_mac.inspect}, band: #{@band.inspect}, duration:"\ " #{@duration.inspect}, format: #{@format.inspect}, max_pkt_len: #{@max_pkt_len.inspect},"\ " num_packets: #{@num_packets.inspect}, ssid: #{@ssid.inspect}, type: #{@type.inspect},"\ " wlan_id: #{@wlan_id.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
142 143 144 145 146 147 |
# File 'lib/mist_api/models/capture_wireless.rb', line 142 def to_s class_name = self.class.name.split('::').last "<#{class_name} ap_mac: #{@ap_mac}, band: #{@band}, duration: #{@duration}, format:"\ " #{@format}, max_pkt_len: #{@max_pkt_len}, num_packets: #{@num_packets}, ssid: #{@ssid},"\ " type: #{@type}, wlan_id: #{@wlan_id}, additional_properties: #{@additional_properties}>" end |