Class: MistApi::WebhookDiscoveredRawRssiEvent
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- MistApi::WebhookDiscoveredRawRssiEvent
- Defined in:
- lib/mist_api/models/webhook_discovered_raw_rssi_event.rb
Overview
WebhookDiscoveredRawRssiEvent Model.
Instance Attribute Summary collapse
-
#ap_loc ⇒ Array[Float]
coordinates (if any) of reporting AP (updated once in 60s per client).
-
#beam ⇒ Integer
Antenna index, from 1-8, clock-wise starting from the LED.
-
#device_id ⇒ UUID | String
Device id of the reporting AP.
-
#ibeacon_major ⇒ Integer
Major number for iBeacon.
-
#ibeacon_minor ⇒ Integer
Minor number for iBeacon.
-
#ibeacon_uuid ⇒ UUID | String
Minor number for iBeacon.
-
#is_asset ⇒ TrueClass | FalseClass
Minor number for iBeacon.
-
#mac ⇒ String
MAC of the asset/ beacon.
-
#map_id ⇒ UUID | String
MAC of the asset/ beacon.
-
#mfg_company_id ⇒ String
BLE manufacturing company ID.
-
#mfg_data ⇒ String
BLE manufacturing data in hex byte-string format (ie: “112233AABBCC”).
-
#org_id ⇒ UUID | String
BLE manufacturing data in hex byte-string format (ie: “112233AABBCC”).
-
#rssi ⇒ Float
Signal strength.
-
#service_packets ⇒ Array[ServicePacket]
List of service data packets heard from the asset/ beacon.
-
#site_id ⇒ UUID | String
List of service data packets heard from the asset/ beacon.
-
#timestamp ⇒ Float
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.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(beam = nil, device_id = nil, mac = nil, map_id = nil, org_id = nil, rssi = nil, site_id = nil, ap_loc = SKIP, ibeacon_major = SKIP, ibeacon_minor = SKIP, ibeacon_uuid = SKIP, is_asset = SKIP, mfg_company_id = SKIP, mfg_data = SKIP, service_packets = SKIP, timestamp = SKIP) ⇒ WebhookDiscoveredRawRssiEvent
constructor
A new instance of WebhookDiscoveredRawRssiEvent.
-
#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(beam = nil, device_id = nil, mac = nil, map_id = nil, org_id = nil, rssi = nil, site_id = nil, ap_loc = SKIP, ibeacon_major = SKIP, ibeacon_minor = SKIP, ibeacon_uuid = SKIP, is_asset = SKIP, mfg_company_id = SKIP, mfg_data = SKIP, service_packets = SKIP, timestamp = SKIP) ⇒ WebhookDiscoveredRawRssiEvent
Returns a new instance of WebhookDiscoveredRawRssiEvent.
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/mist_api/models/webhook_discovered_raw_rssi_event.rb', line 122 def initialize(beam = nil, device_id = nil, mac = nil, map_id = nil, org_id = nil, rssi = nil, site_id = nil, ap_loc = SKIP, ibeacon_major = SKIP, ibeacon_minor = SKIP, ibeacon_uuid = SKIP, is_asset = SKIP, mfg_company_id = SKIP, mfg_data = SKIP, service_packets = SKIP, = SKIP) @ap_loc = ap_loc unless ap_loc == SKIP @beam = beam @device_id = device_id @ibeacon_major = ibeacon_major unless ibeacon_major == SKIP @ibeacon_minor = ibeacon_minor unless ibeacon_minor == SKIP @ibeacon_uuid = ibeacon_uuid unless ibeacon_uuid == SKIP @is_asset = is_asset unless is_asset == SKIP @mac = mac @map_id = map_id @mfg_company_id = mfg_company_id unless mfg_company_id == SKIP @mfg_data = mfg_data unless mfg_data == SKIP @org_id = org_id @rssi = rssi @service_packets = service_packets unless service_packets == SKIP @site_id = site_id @timestamp = unless == SKIP end |
Instance Attribute Details
#ap_loc ⇒ Array[Float]
coordinates (if any) of reporting AP (updated once in 60s per client)
14 15 16 |
# File 'lib/mist_api/models/webhook_discovered_raw_rssi_event.rb', line 14 def ap_loc @ap_loc end |
#beam ⇒ Integer
Antenna index, from 1-8, clock-wise starting from the LED
18 19 20 |
# File 'lib/mist_api/models/webhook_discovered_raw_rssi_event.rb', line 18 def beam @beam end |
#device_id ⇒ UUID | String
Device id of the reporting AP
22 23 24 |
# File 'lib/mist_api/models/webhook_discovered_raw_rssi_event.rb', line 22 def device_id @device_id end |
#ibeacon_major ⇒ Integer
Major number for iBeacon
26 27 28 |
# File 'lib/mist_api/models/webhook_discovered_raw_rssi_event.rb', line 26 def ibeacon_major @ibeacon_major end |
#ibeacon_minor ⇒ Integer
Minor number for iBeacon
30 31 32 |
# File 'lib/mist_api/models/webhook_discovered_raw_rssi_event.rb', line 30 def ibeacon_minor @ibeacon_minor end |
#ibeacon_uuid ⇒ UUID | String
Minor number for iBeacon
34 35 36 |
# File 'lib/mist_api/models/webhook_discovered_raw_rssi_event.rb', line 34 def ibeacon_uuid @ibeacon_uuid end |
#is_asset ⇒ TrueClass | FalseClass
Minor number for iBeacon
38 39 40 |
# File 'lib/mist_api/models/webhook_discovered_raw_rssi_event.rb', line 38 def is_asset @is_asset end |
#mac ⇒ String
MAC of the asset/ beacon
42 43 44 |
# File 'lib/mist_api/models/webhook_discovered_raw_rssi_event.rb', line 42 def mac @mac end |
#map_id ⇒ UUID | String
MAC of the asset/ beacon
46 47 48 |
# File 'lib/mist_api/models/webhook_discovered_raw_rssi_event.rb', line 46 def map_id @map_id end |
#mfg_company_id ⇒ String
BLE manufacturing company ID
50 51 52 |
# File 'lib/mist_api/models/webhook_discovered_raw_rssi_event.rb', line 50 def mfg_company_id @mfg_company_id end |
#mfg_data ⇒ String
BLE manufacturing data in hex byte-string format (ie: “112233AABBCC”)
54 55 56 |
# File 'lib/mist_api/models/webhook_discovered_raw_rssi_event.rb', line 54 def mfg_data @mfg_data end |
#org_id ⇒ UUID | String
BLE manufacturing data in hex byte-string format (ie: “112233AABBCC”)
58 59 60 |
# File 'lib/mist_api/models/webhook_discovered_raw_rssi_event.rb', line 58 def org_id @org_id end |
#rssi ⇒ Float
Signal strength
62 63 64 |
# File 'lib/mist_api/models/webhook_discovered_raw_rssi_event.rb', line 62 def rssi @rssi end |
#service_packets ⇒ Array[ServicePacket]
List of service data packets heard from the asset/ beacon
66 67 68 |
# File 'lib/mist_api/models/webhook_discovered_raw_rssi_event.rb', line 66 def service_packets @service_packets end |
#site_id ⇒ UUID | String
List of service data packets heard from the asset/ beacon
70 71 72 |
# File 'lib/mist_api/models/webhook_discovered_raw_rssi_event.rb', line 70 def site_id @site_id end |
#timestamp ⇒ Float
Epoch (seconds)
74 75 76 |
# File 'lib/mist_api/models/webhook_discovered_raw_rssi_event.rb', line 74 def @timestamp end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
# File 'lib/mist_api/models/webhook_discovered_raw_rssi_event.rb', line 146 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. beam = hash.key?('beam') ? hash['beam'] : nil device_id = hash.key?('device_id') ? hash['device_id'] : nil mac = hash.key?('mac') ? hash['mac'] : nil map_id = hash.key?('map_id') ? hash['map_id'] : nil org_id = hash.key?('org_id') ? hash['org_id'] : nil rssi = hash.key?('rssi') ? hash['rssi'] : nil site_id = hash.key?('site_id') ? hash['site_id'] : nil ap_loc = hash.key?('ap_loc') ? hash['ap_loc'] : SKIP ibeacon_major = hash.key?('ibeacon_major') ? hash['ibeacon_major'] : SKIP ibeacon_minor = hash.key?('ibeacon_minor') ? hash['ibeacon_minor'] : SKIP ibeacon_uuid = hash.key?('ibeacon_uuid') ? hash['ibeacon_uuid'] : SKIP is_asset = hash.key?('is_asset') ? hash['is_asset'] : SKIP mfg_company_id = hash.key?('mfg_company_id') ? hash['mfg_company_id'] : SKIP mfg_data = hash.key?('mfg_data') ? hash['mfg_data'] : SKIP # Parameter is an array, so we need to iterate through it service_packets = nil unless hash['service_packets'].nil? service_packets = [] hash['service_packets'].each do |structure| service_packets << (ServicePacket.from_hash(structure) if structure) end end service_packets = SKIP unless hash.key?('service_packets') = hash.key?('timestamp') ? hash['timestamp'] : SKIP # Create object from extracted values. WebhookDiscoveredRawRssiEvent.new(beam, device_id, mac, map_id, org_id, rssi, site_id, ap_loc, ibeacon_major, ibeacon_minor, ibeacon_uuid, is_asset, mfg_company_id, mfg_data, service_packets, ) end |
.names ⇒ Object
A mapping from model property names to API property names.
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/mist_api/models/webhook_discovered_raw_rssi_event.rb', line 77 def self.names @_hash = {} if @_hash.nil? @_hash['ap_loc'] = 'ap_loc' @_hash['beam'] = 'beam' @_hash['device_id'] = 'device_id' @_hash['ibeacon_major'] = 'ibeacon_major' @_hash['ibeacon_minor'] = 'ibeacon_minor' @_hash['ibeacon_uuid'] = 'ibeacon_uuid' @_hash['is_asset'] = 'is_asset' @_hash['mac'] = 'mac' @_hash['map_id'] = 'map_id' @_hash['mfg_company_id'] = 'mfg_company_id' @_hash['mfg_data'] = 'mfg_data' @_hash['org_id'] = 'org_id' @_hash['rssi'] = 'rssi' @_hash['service_packets'] = 'service_packets' @_hash['site_id'] = 'site_id' @_hash['timestamp'] = 'timestamp' @_hash end |
.nullables ⇒ Object
An array for nullable fields
114 115 116 117 118 119 120 |
# File 'lib/mist_api/models/webhook_discovered_raw_rssi_event.rb', line 114 def self.nullables %w[ ibeacon_major ibeacon_minor ibeacon_uuid ] end |
.optionals ⇒ Object
An array for optional fields
99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/mist_api/models/webhook_discovered_raw_rssi_event.rb', line 99 def self.optionals %w[ ap_loc ibeacon_major ibeacon_minor ibeacon_uuid is_asset mfg_company_id mfg_data service_packets timestamp ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 |
# File 'lib/mist_api/models/webhook_discovered_raw_rssi_event.rb', line 198 def self.validate(value) if value.instance_of? self return ( APIHelper.valid_type?(value.beam, ->(val) { val.instance_of? Integer }) and APIHelper.valid_type?(value.device_id, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.mac, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.map_id, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.org_id, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.rssi, ->(val) { val.instance_of? Float }) and APIHelper.valid_type?(value.site_id, ->(val) { val.instance_of? String }) ) end return false unless value.instance_of? Hash ( APIHelper.valid_type?(value['beam'], ->(val) { val.instance_of? Integer }) and APIHelper.valid_type?(value['device_id'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['mac'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['map_id'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['org_id'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['rssi'], ->(val) { val.instance_of? Float }) and APIHelper.valid_type?(value['site_id'], ->(val) { val.instance_of? String }) ) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
250 251 252 253 254 255 256 257 258 259 |
# File 'lib/mist_api/models/webhook_discovered_raw_rssi_event.rb', line 250 def inspect class_name = self.class.name.split('::').last "<#{class_name} ap_loc: #{@ap_loc.inspect}, beam: #{@beam.inspect}, device_id:"\ " #{@device_id.inspect}, ibeacon_major: #{@ibeacon_major.inspect}, ibeacon_minor:"\ " #{@ibeacon_minor.inspect}, ibeacon_uuid: #{@ibeacon_uuid.inspect}, is_asset:"\ " #{@is_asset.inspect}, mac: #{@mac.inspect}, map_id: #{@map_id.inspect}, mfg_company_id:"\ " #{@mfg_company_id.inspect}, mfg_data: #{@mfg_data.inspect}, org_id: #{@org_id.inspect},"\ " rssi: #{@rssi.inspect}, service_packets: #{@service_packets.inspect}, site_id:"\ " #{@site_id.inspect}, timestamp: #{@timestamp.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
239 240 241 242 243 244 245 246 247 |
# File 'lib/mist_api/models/webhook_discovered_raw_rssi_event.rb', line 239 def to_s class_name = self.class.name.split('::').last "<#{class_name} ap_loc: #{@ap_loc}, beam: #{@beam}, device_id: #{@device_id},"\ " ibeacon_major: #{@ibeacon_major}, ibeacon_minor: #{@ibeacon_minor}, ibeacon_uuid:"\ " #{@ibeacon_uuid}, is_asset: #{@is_asset}, mac: #{@mac}, map_id: #{@map_id},"\ " mfg_company_id: #{@mfg_company_id}, mfg_data: #{@mfg_data}, org_id: #{@org_id}, rssi:"\ " #{@rssi}, service_packets: #{@service_packets}, site_id: #{@site_id}, timestamp:"\ " #{@timestamp}>" end |