Class: MistApi::WebhookAssetRawRssiEvent
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- MistApi::WebhookAssetRawRssiEvent
- Defined in:
- lib/mist_api/models/webhook_asset_raw_rssi_event.rb
Overview
WebhookAssetRawRssiEvent Model.
Instance Attribute Summary collapse
-
#ap_loc ⇒ Array[Float]
optional, coordinates (if any) of reporting AP (updated once in 60s per client).
-
#beam ⇒ Integer
antenna index, clock-wise starting from the LED.
-
#device_id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization.
-
#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
Unique ID of the object instance in the Mist Organization.
-
#mfg_company_id ⇒ Integer
optional, BLE manufacturing company ID.
-
#mfg_data ⇒ String
optional, BLE manufacturing data in hex byte-string format (ie “112233AABBCC”).
-
#org_id ⇒ UUID | String
optional, BLE manufacturing data in hex byte-string format (ie “112233AABBCC”).
-
#rssi ⇒ Integer
optional, BLE manufacturing data in hex byte-string format (ie “112233AABBCC”).
-
#service_packets ⇒ Array[WebhookAssetRawRssiEventServicePacket]
optional, BLE manufacturing data in hex byte-string format (ie “112233AABBCC”).
-
#site_id ⇒ UUID | String
optional, BLE manufacturing data in hex byte-string format (ie “112233AABBCC”).
-
#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(ap_loc = SKIP, beam = SKIP, device_id = SKIP, ibeacon_major = SKIP, ibeacon_minor = SKIP, ibeacon_uuid = SKIP, is_asset = SKIP, mac = SKIP, map_id = SKIP, mfg_company_id = SKIP, mfg_data = SKIP, org_id = SKIP, rssi = SKIP, service_packets = SKIP, site_id = SKIP, timestamp = SKIP) ⇒ WebhookAssetRawRssiEvent
constructor
A new instance of WebhookAssetRawRssiEvent.
-
#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_loc = SKIP, beam = SKIP, device_id = SKIP, ibeacon_major = SKIP, ibeacon_minor = SKIP, ibeacon_uuid = SKIP, is_asset = SKIP, mac = SKIP, map_id = SKIP, mfg_company_id = SKIP, mfg_data = SKIP, org_id = SKIP, rssi = SKIP, service_packets = SKIP, site_id = SKIP, timestamp = SKIP) ⇒ WebhookAssetRawRssiEvent
Returns a new instance of WebhookAssetRawRssiEvent.
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/mist_api/models/webhook_asset_raw_rssi_event.rb', line 137 def initialize(ap_loc = SKIP, beam = SKIP, device_id = SKIP, ibeacon_major = SKIP, ibeacon_minor = SKIP, ibeacon_uuid = SKIP, is_asset = SKIP, mac = SKIP, map_id = SKIP, mfg_company_id = SKIP, mfg_data = SKIP, org_id = SKIP, rssi = SKIP, service_packets = SKIP, site_id = SKIP, = SKIP) @ap_loc = ap_loc unless ap_loc == SKIP @beam = beam unless beam == SKIP @device_id = device_id unless device_id == SKIP @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 unless mac == SKIP @map_id = map_id unless map_id == SKIP @mfg_company_id = mfg_company_id unless mfg_company_id == SKIP @mfg_data = mfg_data unless mfg_data == SKIP @org_id = org_id unless org_id == SKIP @rssi = rssi unless rssi == SKIP @service_packets = service_packets unless service_packets == SKIP @site_id = site_id unless site_id == SKIP @timestamp = unless == SKIP end |
Instance Attribute Details
#ap_loc ⇒ Array[Float]
optional, coordinates (if any) of reporting AP (updated once in 60s per client)
15 16 17 |
# File 'lib/mist_api/models/webhook_asset_raw_rssi_event.rb', line 15 def ap_loc @ap_loc end |
#beam ⇒ Integer
antenna index, clock-wise starting from the LED
19 20 21 |
# File 'lib/mist_api/models/webhook_asset_raw_rssi_event.rb', line 19 def beam @beam end |
#device_id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization
23 24 25 |
# File 'lib/mist_api/models/webhook_asset_raw_rssi_event.rb', line 23 def device_id @device_id end |
#ibeacon_major ⇒ Integer
Major number for iBeacon
27 28 29 |
# File 'lib/mist_api/models/webhook_asset_raw_rssi_event.rb', line 27 def ibeacon_major @ibeacon_major end |
#ibeacon_minor ⇒ Integer
Minor number for iBeacon
31 32 33 |
# File 'lib/mist_api/models/webhook_asset_raw_rssi_event.rb', line 31 def ibeacon_minor @ibeacon_minor end |
#ibeacon_uuid ⇒ UUID | String
Minor number for iBeacon
35 36 37 |
# File 'lib/mist_api/models/webhook_asset_raw_rssi_event.rb', line 35 def ibeacon_uuid @ibeacon_uuid end |
#is_asset ⇒ TrueClass | FalseClass
Minor number for iBeacon
39 40 41 |
# File 'lib/mist_api/models/webhook_asset_raw_rssi_event.rb', line 39 def is_asset @is_asset end |
#mac ⇒ String
MAC of the asset/ beacon
43 44 45 |
# File 'lib/mist_api/models/webhook_asset_raw_rssi_event.rb', line 43 def mac @mac end |
#map_id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization
47 48 49 |
# File 'lib/mist_api/models/webhook_asset_raw_rssi_event.rb', line 47 def map_id @map_id end |
#mfg_company_id ⇒ Integer
optional, BLE manufacturing company ID
51 52 53 |
# File 'lib/mist_api/models/webhook_asset_raw_rssi_event.rb', line 51 def mfg_company_id @mfg_company_id end |
#mfg_data ⇒ String
optional, BLE manufacturing data in hex byte-string format (ie “112233AABBCC”)
56 57 58 |
# File 'lib/mist_api/models/webhook_asset_raw_rssi_event.rb', line 56 def mfg_data @mfg_data end |
#org_id ⇒ UUID | String
optional, BLE manufacturing data in hex byte-string format (ie “112233AABBCC”)
61 62 63 |
# File 'lib/mist_api/models/webhook_asset_raw_rssi_event.rb', line 61 def org_id @org_id end |
#rssi ⇒ Integer
optional, BLE manufacturing data in hex byte-string format (ie “112233AABBCC”)
66 67 68 |
# File 'lib/mist_api/models/webhook_asset_raw_rssi_event.rb', line 66 def rssi @rssi end |
#service_packets ⇒ Array[WebhookAssetRawRssiEventServicePacket]
optional, BLE manufacturing data in hex byte-string format (ie “112233AABBCC”)
71 72 73 |
# File 'lib/mist_api/models/webhook_asset_raw_rssi_event.rb', line 71 def service_packets @service_packets end |
#site_id ⇒ UUID | String
optional, BLE manufacturing data in hex byte-string format (ie “112233AABBCC”)
76 77 78 |
# File 'lib/mist_api/models/webhook_asset_raw_rssi_event.rb', line 76 def site_id @site_id end |
#timestamp ⇒ Float
Epoch (seconds)
80 81 82 |
# File 'lib/mist_api/models/webhook_asset_raw_rssi_event.rb', line 80 def @timestamp end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 |
# File 'lib/mist_api/models/webhook_asset_raw_rssi_event.rb', line 162 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. ap_loc = hash.key?('ap_loc') ? hash['ap_loc'] : SKIP beam = hash.key?('beam') ? hash['beam'] : SKIP device_id = hash.key?('device_id') ? hash['device_id'] : 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 mac = hash.key?('mac') ? hash['mac'] : SKIP map_id = hash.key?('map_id') ? hash['map_id'] : SKIP mfg_company_id = hash.key?('mfg_company_id') ? hash['mfg_company_id'] : SKIP mfg_data = hash.key?('mfg_data') ? hash['mfg_data'] : SKIP org_id = hash.key?('org_id') ? hash['org_id'] : SKIP rssi = hash.key?('rssi') ? hash['rssi'] : 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 << (WebhookAssetRawRssiEventServicePacket.from_hash(structure) if structure) end end service_packets = SKIP unless hash.key?('service_packets') site_id = hash.key?('site_id') ? hash['site_id'] : SKIP = hash.key?('timestamp') ? hash['timestamp'] : SKIP # Create object from extracted values. WebhookAssetRawRssiEvent.new(ap_loc, beam, device_id, ibeacon_major, ibeacon_minor, ibeacon_uuid, is_asset, mac, map_id, mfg_company_id, mfg_data, org_id, rssi, service_packets, site_id, ) end |
.names ⇒ Object
A mapping from model property names to API property names.
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/mist_api/models/webhook_asset_raw_rssi_event.rb', line 83 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
127 128 129 130 131 132 133 134 135 |
# File 'lib/mist_api/models/webhook_asset_raw_rssi_event.rb', line 127 def self.nullables %w[ ibeacon_major ibeacon_minor ibeacon_uuid mfg_company_id mfg_data ] end |
.optionals ⇒ Object
An array for optional fields
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
# File 'lib/mist_api/models/webhook_asset_raw_rssi_event.rb', line 105 def self.optionals %w[ ap_loc beam device_id ibeacon_major ibeacon_minor ibeacon_uuid is_asset mac map_id mfg_company_id mfg_data org_id rssi service_packets site_id timestamp ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
214 215 216 217 218 219 220 |
# File 'lib/mist_api/models/webhook_asset_raw_rssi_event.rb', line 214 def self.validate(value) return true if value.instance_of? self return false unless value.instance_of? Hash true end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
234 235 236 237 238 239 240 241 242 243 |
# File 'lib/mist_api/models/webhook_asset_raw_rssi_event.rb', line 234 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.
223 224 225 226 227 228 229 230 231 |
# File 'lib/mist_api/models/webhook_asset_raw_rssi_event.rb', line 223 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 |