Class: MistApi::ResponsePastSpectrumAnalysisResult
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- MistApi::ResponsePastSpectrumAnalysisResult
- Defined in:
- lib/mist_api/models/response_past_spectrum_analysis_result.rb
Overview
Result of a past spectrum analysis
Instance Attribute Summary collapse
-
#band ⇒ String
Band on which the spectrum analysis was run (e.g., 24, 5, 6).
-
#channel_usage ⇒ Array[ResponsePastSpectrumAnalysisChannelUsage]
Band on which the spectrum analysis was run (e.g., 24, 5, 6).
-
#fft_samples ⇒ Array[ResponsePastSpectrumAnalysisFftSample]
List of FFT samples for the spectrum analysis.
-
#mac ⇒ String
MAC Address of the AP that ran the spectrum analysis.
-
#org_id ⇒ UUID | String
MAC Address of the AP that ran the spectrum analysis.
-
#timestamp ⇒ Integer
Timestamp when the spectrum analysis was run in epoch seconds.
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(band = SKIP, channel_usage = SKIP, fft_samples = SKIP, mac = SKIP, org_id = SKIP, timestamp = SKIP) ⇒ ResponsePastSpectrumAnalysisResult
constructor
A new instance of ResponsePastSpectrumAnalysisResult.
-
#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(band = SKIP, channel_usage = SKIP, fft_samples = SKIP, mac = SKIP, org_id = SKIP, timestamp = SKIP) ⇒ ResponsePastSpectrumAnalysisResult
Returns a new instance of ResponsePastSpectrumAnalysisResult.
65 66 67 68 69 70 71 72 73 |
# File 'lib/mist_api/models/response_past_spectrum_analysis_result.rb', line 65 def initialize(band = SKIP, channel_usage = SKIP, fft_samples = SKIP, mac = SKIP, org_id = SKIP, = SKIP) @band = band unless band == SKIP @channel_usage = channel_usage unless channel_usage == SKIP @fft_samples = fft_samples unless fft_samples == SKIP @mac = mac unless mac == SKIP @org_id = org_id unless org_id == SKIP @timestamp = unless == SKIP end |
Instance Attribute Details
#band ⇒ String
Band on which the spectrum analysis was run (e.g., 24, 5, 6)
14 15 16 |
# File 'lib/mist_api/models/response_past_spectrum_analysis_result.rb', line 14 def band @band end |
#channel_usage ⇒ Array[ResponsePastSpectrumAnalysisChannelUsage]
Band on which the spectrum analysis was run (e.g., 24, 5, 6)
18 19 20 |
# File 'lib/mist_api/models/response_past_spectrum_analysis_result.rb', line 18 def channel_usage @channel_usage end |
#fft_samples ⇒ Array[ResponsePastSpectrumAnalysisFftSample]
List of FFT samples for the spectrum analysis
22 23 24 |
# File 'lib/mist_api/models/response_past_spectrum_analysis_result.rb', line 22 def fft_samples @fft_samples end |
#mac ⇒ String
MAC Address of the AP that ran the spectrum analysis
26 27 28 |
# File 'lib/mist_api/models/response_past_spectrum_analysis_result.rb', line 26 def mac @mac end |
#org_id ⇒ UUID | String
MAC Address of the AP that ran the spectrum analysis
30 31 32 |
# File 'lib/mist_api/models/response_past_spectrum_analysis_result.rb', line 30 def org_id @org_id end |
#timestamp ⇒ Integer
Timestamp when the spectrum analysis was run in epoch seconds
34 35 36 |
# File 'lib/mist_api/models/response_past_spectrum_analysis_result.rb', line 34 def @timestamp end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/mist_api/models/response_past_spectrum_analysis_result.rb', line 76 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. band = hash.key?('band') ? hash['band'] : SKIP # Parameter is an array, so we need to iterate through it channel_usage = nil unless hash['channel_usage'].nil? channel_usage = [] hash['channel_usage'].each do |structure| channel_usage << (ResponsePastSpectrumAnalysisChannelUsage.from_hash(structure) if structure) end end channel_usage = SKIP unless hash.key?('channel_usage') # Parameter is an array, so we need to iterate through it fft_samples = nil unless hash['fft_samples'].nil? fft_samples = [] hash['fft_samples'].each do |structure| fft_samples << (ResponsePastSpectrumAnalysisFftSample.from_hash(structure) if structure) end end fft_samples = SKIP unless hash.key?('fft_samples') mac = hash.key?('mac') ? hash['mac'] : SKIP org_id = hash.key?('org_id') ? hash['org_id'] : SKIP = hash.key?('timestamp') ? hash['timestamp'] : SKIP # Create object from extracted values. ResponsePastSpectrumAnalysisResult.new(band, channel_usage, fft_samples, mac, org_id, ) end |
.names ⇒ Object
A mapping from model property names to API property names.
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/mist_api/models/response_past_spectrum_analysis_result.rb', line 37 def self.names @_hash = {} if @_hash.nil? @_hash['band'] = 'band' @_hash['channel_usage'] = 'channel_usage' @_hash['fft_samples'] = 'fft_samples' @_hash['mac'] = 'mac' @_hash['org_id'] = 'org_id' @_hash['timestamp'] = 'timestamp' @_hash end |
.nullables ⇒ Object
An array for nullable fields
61 62 63 |
# File 'lib/mist_api/models/response_past_spectrum_analysis_result.rb', line 61 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/mist_api/models/response_past_spectrum_analysis_result.rb', line 49 def self.optionals %w[ band channel_usage fft_samples mac org_id timestamp ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
122 123 124 125 126 127 |
# File 'lib/mist_api/models/response_past_spectrum_analysis_result.rb', line 122 def inspect class_name = self.class.name.split('::').last "<#{class_name} band: #{@band.inspect}, channel_usage: #{@channel_usage.inspect},"\ " fft_samples: #{@fft_samples.inspect}, mac: #{@mac.inspect}, org_id: #{@org_id.inspect},"\ " timestamp: #{@timestamp.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
115 116 117 118 119 |
# File 'lib/mist_api/models/response_past_spectrum_analysis_result.rb', line 115 def to_s class_name = self.class.name.split('::').last "<#{class_name} band: #{@band}, channel_usage: #{@channel_usage}, fft_samples:"\ " #{@fft_samples}, mac: #{@mac}, org_id: #{@org_id}, timestamp: #{@timestamp}>" end |