Class: MistApi::SpectrumAnalysis
- Defined in:
- lib/mist_api/models/spectrum_analysis.rb
Overview
SpectrumAnalysis Model.
Instance Attribute Summary collapse
-
#band ⇒ SpectrumAnalysisBandEnum
Band for spectrum analysis.
-
#channels ⇒ Array[String]
Optional list of channels to scan.
-
#device_id ⇒ UUID | String
Device ID of the AP that is performing spectrum analysis.
-
#duration ⇒ Integer
Duration of the spectrum analysis in seconds.
-
#format ⇒ SpectrumAnalysisFormatEnum
Format of the spectrum analysis data.
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 = nil, channels = SKIP, device_id = SKIP, duration = 300, format = SpectrumAnalysisFormatEnum::JSON, additional_properties = nil) ⇒ SpectrumAnalysis
constructor
A new instance of SpectrumAnalysis.
-
#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 = nil, channels = SKIP, device_id = SKIP, duration = 300, format = SpectrumAnalysisFormatEnum::JSON, additional_properties = nil) ⇒ SpectrumAnalysis
Returns a new instance of SpectrumAnalysis.
59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/mist_api/models/spectrum_analysis.rb', line 59 def initialize(band = nil, channels = SKIP, device_id = SKIP, duration = 300, format = SpectrumAnalysisFormatEnum::JSON, additional_properties = nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @band = band @channels = channels unless channels == SKIP @device_id = device_id unless device_id == SKIP @duration = duration unless duration == SKIP @format = format unless format == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#band ⇒ SpectrumAnalysisBandEnum
Band for spectrum analysis. enum: ‘24`, `5`, `6`
14 15 16 |
# File 'lib/mist_api/models/spectrum_analysis.rb', line 14 def band @band end |
#channels ⇒ Array[String]
Optional list of channels to scan. If not specified, all supported channels will be scanned
19 20 21 |
# File 'lib/mist_api/models/spectrum_analysis.rb', line 19 def channels @channels end |
#device_id ⇒ UUID | String
Device ID of the AP that is performing spectrum analysis
23 24 25 |
# File 'lib/mist_api/models/spectrum_analysis.rb', line 23 def device_id @device_id end |
#duration ⇒ Integer
Duration of the spectrum analysis in seconds
27 28 29 |
# File 'lib/mist_api/models/spectrum_analysis.rb', line 27 def duration @duration end |
#format ⇒ SpectrumAnalysisFormatEnum
Format of the spectrum analysis data. enum: ‘json`, `stream`
31 32 33 |
# File 'lib/mist_api/models/spectrum_analysis.rb', line 31 def format @format end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/mist_api/models/spectrum_analysis.rb', line 74 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. band = hash.key?('band') ? hash['band'] : nil channels = hash.key?('channels') ? hash['channels'] : SKIP device_id = hash.key?('device_id') ? hash['device_id'] : SKIP duration = hash['duration'] ||= 300 format = hash['format'] ||= SpectrumAnalysisFormatEnum::JSON # 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. SpectrumAnalysis.new(band, channels, device_id, duration, format, additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
34 35 36 37 38 39 40 41 42 |
# File 'lib/mist_api/models/spectrum_analysis.rb', line 34 def self.names @_hash = {} if @_hash.nil? @_hash['band'] = 'band' @_hash['channels'] = 'channels' @_hash['device_id'] = 'device_id' @_hash['duration'] = 'duration' @_hash['format'] = 'format' @_hash end |
.nullables ⇒ Object
An array for nullable fields
55 56 57 |
# File 'lib/mist_api/models/spectrum_analysis.rb', line 55 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
45 46 47 48 49 50 51 52 |
# File 'lib/mist_api/models/spectrum_analysis.rb', line 45 def self.optionals %w[ channels device_id duration format ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
108 109 110 111 112 113 |
# File 'lib/mist_api/models/spectrum_analysis.rb', line 108 def inspect class_name = self.class.name.split('::').last "<#{class_name} band: #{@band.inspect}, channels: #{@channels.inspect}, device_id:"\ " #{@device_id.inspect}, duration: #{@duration.inspect}, format: #{@format.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
101 102 103 104 105 |
# File 'lib/mist_api/models/spectrum_analysis.rb', line 101 def to_s class_name = self.class.name.split('::').last "<#{class_name} band: #{@band}, channels: #{@channels}, device_id: #{@device_id}, duration:"\ " #{@duration}, format: #{@format}, additional_properties: #{@additional_properties}>" end |