Class: MistApi::WebhookLocationEvent
- Defined in:
- lib/mist_api/models/webhook_location_event.rb
Overview
WebhookLocationEvent Model.
Instance Attribute Summary collapse
-
#battery_voltage ⇒ Integer
TODO: Write general description for this method.
-
#eddystone_uid_instance ⇒ String
TODO: Write general description for this method.
-
#eddystone_uid_namespace ⇒ String
TODO: Write general description for this method.
-
#eddystone_url_url ⇒ String
TODO: Write general description for this method.
-
#ibeacon_major ⇒ Integer
Major number for iBeacon.
-
#ibeacon_minor ⇒ Integer
Minor number for iBeacon.
-
#ibeacon_uuid ⇒ UUID | String
Minor number for iBeacon.
-
#id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization.
-
#mac ⇒ String
Unique ID of the object instance in the Mist Organization.
-
#map_id ⇒ UUID | String
Map id.
-
#mfg_company_id ⇒ Integer
Optional, BLE manufacturing company ID.
-
#mfg_data ⇒ String
Optional, BLE manufacturing data in hex byte-string format (ie “112233AABBCC”).
-
#name ⇒ String
Name of the client, may be empty.
-
#site_id ⇒ UUID | String
Name of the client, may be empty.
-
#timestamp ⇒ Float
Epoch (seconds).
-
#type ⇒ String
Epoch (seconds).
-
#wifi_beacon_extended_info ⇒ Array[WifiBeaconExtendedInfoItems]
Optional, list of extended beacon info packets heard from the client, frame and sequence control included with the payload.
-
#x ⇒ Float
x, in meter.
-
#y ⇒ Float
y, in meter.
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(id = nil, map_id = nil, site_id = nil, timestamp = nil, type = nil, x = nil, y = nil, battery_voltage = SKIP, eddystone_uid_instance = SKIP, eddystone_uid_namespace = SKIP, eddystone_url_url = SKIP, ibeacon_major = SKIP, ibeacon_minor = SKIP, ibeacon_uuid = SKIP, mac = SKIP, mfg_company_id = SKIP, mfg_data = SKIP, name = SKIP, wifi_beacon_extended_info = SKIP) ⇒ WebhookLocationEvent
constructor
A new instance of WebhookLocationEvent.
-
#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(id = nil, map_id = nil, site_id = nil, timestamp = nil, type = nil, x = nil, y = nil, battery_voltage = SKIP, eddystone_uid_instance = SKIP, eddystone_uid_namespace = SKIP, eddystone_url_url = SKIP, ibeacon_major = SKIP, ibeacon_minor = SKIP, ibeacon_uuid = SKIP, mac = SKIP, mfg_company_id = SKIP, mfg_data = SKIP, name = SKIP, wifi_beacon_extended_info = SKIP) ⇒ WebhookLocationEvent
Returns a new instance of WebhookLocationEvent.
142 143 144 145 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 |
# File 'lib/mist_api/models/webhook_location_event.rb', line 142 def initialize(id = nil, map_id = nil, site_id = nil, = nil, type = nil, x = nil, y = nil, battery_voltage = SKIP, eddystone_uid_instance = SKIP, eddystone_uid_namespace = SKIP, eddystone_url_url = SKIP, ibeacon_major = SKIP, ibeacon_minor = SKIP, ibeacon_uuid = SKIP, mac = SKIP, mfg_company_id = SKIP, mfg_data = SKIP, name = SKIP, wifi_beacon_extended_info = SKIP) @battery_voltage = battery_voltage unless battery_voltage == SKIP @eddystone_uid_instance = eddystone_uid_instance unless eddystone_uid_instance == SKIP @eddystone_uid_namespace = eddystone_uid_namespace unless eddystone_uid_namespace == SKIP @eddystone_url_url = eddystone_url_url unless eddystone_url_url == 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 @id = id @mac = mac unless mac == SKIP @map_id = map_id @mfg_company_id = mfg_company_id unless mfg_company_id == SKIP @mfg_data = mfg_data unless mfg_data == SKIP @name = name unless name == SKIP @site_id = site_id @timestamp = @type = type unless wifi_beacon_extended_info == SKIP @wifi_beacon_extended_info = wifi_beacon_extended_info end @x = x @y = y end |
Instance Attribute Details
#battery_voltage ⇒ Integer
TODO: Write general description for this method
14 15 16 |
# File 'lib/mist_api/models/webhook_location_event.rb', line 14 def battery_voltage @battery_voltage end |
#eddystone_uid_instance ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/mist_api/models/webhook_location_event.rb', line 18 def eddystone_uid_instance @eddystone_uid_instance end |
#eddystone_uid_namespace ⇒ String
TODO: Write general description for this method
22 23 24 |
# File 'lib/mist_api/models/webhook_location_event.rb', line 22 def eddystone_uid_namespace @eddystone_uid_namespace end |
#eddystone_url_url ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/mist_api/models/webhook_location_event.rb', line 26 def eddystone_url_url @eddystone_url_url end |
#ibeacon_major ⇒ Integer
Major number for iBeacon
30 31 32 |
# File 'lib/mist_api/models/webhook_location_event.rb', line 30 def ibeacon_major @ibeacon_major end |
#ibeacon_minor ⇒ Integer
Minor number for iBeacon
34 35 36 |
# File 'lib/mist_api/models/webhook_location_event.rb', line 34 def ibeacon_minor @ibeacon_minor end |
#ibeacon_uuid ⇒ UUID | String
Minor number for iBeacon
38 39 40 |
# File 'lib/mist_api/models/webhook_location_event.rb', line 38 def ibeacon_uuid @ibeacon_uuid end |
#id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization
42 43 44 |
# File 'lib/mist_api/models/webhook_location_event.rb', line 42 def id @id end |
#mac ⇒ String
Unique ID of the object instance in the Mist Organization
46 47 48 |
# File 'lib/mist_api/models/webhook_location_event.rb', line 46 def mac @mac end |
#map_id ⇒ UUID | String
Map id
50 51 52 |
# File 'lib/mist_api/models/webhook_location_event.rb', line 50 def map_id @map_id end |
#mfg_company_id ⇒ Integer
Optional, BLE manufacturing company ID
54 55 56 |
# File 'lib/mist_api/models/webhook_location_event.rb', line 54 def mfg_company_id @mfg_company_id end |
#mfg_data ⇒ String
Optional, BLE manufacturing data in hex byte-string format (ie “112233AABBCC”)
59 60 61 |
# File 'lib/mist_api/models/webhook_location_event.rb', line 59 def mfg_data @mfg_data end |
#name ⇒ String
Name of the client, may be empty
63 64 65 |
# File 'lib/mist_api/models/webhook_location_event.rb', line 63 def name @name end |
#site_id ⇒ UUID | String
Name of the client, may be empty
67 68 69 |
# File 'lib/mist_api/models/webhook_location_event.rb', line 67 def site_id @site_id end |
#timestamp ⇒ Float
Epoch (seconds)
71 72 73 |
# File 'lib/mist_api/models/webhook_location_event.rb', line 71 def @timestamp end |
#type ⇒ String
Epoch (seconds)
75 76 77 |
# File 'lib/mist_api/models/webhook_location_event.rb', line 75 def type @type end |
#wifi_beacon_extended_info ⇒ Array[WifiBeaconExtendedInfoItems]
Optional, list of extended beacon info packets heard from the client, frame and sequence control included with the payload
80 81 82 |
# File 'lib/mist_api/models/webhook_location_event.rb', line 80 def wifi_beacon_extended_info @wifi_beacon_extended_info end |
#x ⇒ Float
x, in meter
84 85 86 |
# File 'lib/mist_api/models/webhook_location_event.rb', line 84 def x @x end |
#y ⇒ Float
y, in meter
88 89 90 |
# File 'lib/mist_api/models/webhook_location_event.rb', line 88 def y @y end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 |
# File 'lib/mist_api/models/webhook_location_event.rb', line 175 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : nil map_id = hash.key?('map_id') ? hash['map_id'] : nil site_id = hash.key?('site_id') ? hash['site_id'] : nil = hash.key?('timestamp') ? hash['timestamp'] : nil type = hash.key?('type') ? hash['type'] : nil x = hash.key?('x') ? hash['x'] : nil y = hash.key?('y') ? hash['y'] : nil battery_voltage = hash.key?('battery_voltage') ? hash['battery_voltage'] : SKIP eddystone_uid_instance = hash.key?('eddystone_uid_instance') ? hash['eddystone_uid_instance'] : SKIP eddystone_uid_namespace = hash.key?('eddystone_uid_namespace') ? hash['eddystone_uid_namespace'] : SKIP eddystone_url_url = hash.key?('eddystone_url_url') ? hash['eddystone_url_url'] : 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 mac = hash.key?('mac') ? hash['mac'] : SKIP mfg_company_id = hash.key?('mfg_company_id') ? hash['mfg_company_id'] : SKIP mfg_data = hash.key?('mfg_data') ? hash['mfg_data'] : SKIP name = hash.key?('name') ? hash['name'] : SKIP # Parameter is an array, so we need to iterate through it wifi_beacon_extended_info = nil unless hash['wifi_beacon_extended_info'].nil? wifi_beacon_extended_info = [] hash['wifi_beacon_extended_info'].each do |structure| wifi_beacon_extended_info << (WifiBeaconExtendedInfoItems.from_hash(structure) if structure) end end wifi_beacon_extended_info = SKIP unless hash.key?('wifi_beacon_extended_info') # Create object from extracted values. WebhookLocationEvent.new(id, map_id, site_id, , type, x, y, battery_voltage, eddystone_uid_instance, eddystone_uid_namespace, eddystone_url_url, ibeacon_major, ibeacon_minor, ibeacon_uuid, mac, mfg_company_id, mfg_data, name, wifi_beacon_extended_info) end |
.names ⇒ Object
A mapping from model property names to API property names.
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/mist_api/models/webhook_location_event.rb', line 91 def self.names @_hash = {} if @_hash.nil? @_hash['battery_voltage'] = 'battery_voltage' @_hash['eddystone_uid_instance'] = 'eddystone_uid_instance' @_hash['eddystone_uid_namespace'] = 'eddystone_uid_namespace' @_hash['eddystone_url_url'] = 'eddystone_url_url' @_hash['ibeacon_major'] = 'ibeacon_major' @_hash['ibeacon_minor'] = 'ibeacon_minor' @_hash['ibeacon_uuid'] = 'ibeacon_uuid' @_hash['id'] = 'id' @_hash['mac'] = 'mac' @_hash['map_id'] = 'map_id' @_hash['mfg_company_id'] = 'mfg_company_id' @_hash['mfg_data'] = 'mfg_data' @_hash['name'] = 'name' @_hash['site_id'] = 'site_id' @_hash['timestamp'] = 'timestamp' @_hash['type'] = 'type' @_hash['wifi_beacon_extended_info'] = 'wifi_beacon_extended_info' @_hash['x'] = 'x' @_hash['y'] = 'y' @_hash end |
.nullables ⇒ Object
An array for nullable fields
134 135 136 137 138 139 140 |
# File 'lib/mist_api/models/webhook_location_event.rb', line 134 def self.nullables %w[ ibeacon_major ibeacon_minor ibeacon_uuid ] end |
.optionals ⇒ Object
An array for optional fields
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
# File 'lib/mist_api/models/webhook_location_event.rb', line 116 def self.optionals %w[ battery_voltage eddystone_uid_instance eddystone_uid_namespace eddystone_url_url ibeacon_major ibeacon_minor ibeacon_uuid mac mfg_company_id mfg_data name wifi_beacon_extended_info ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 |
# File 'lib/mist_api/models/webhook_location_event.rb', line 237 def self.validate(value) if value.instance_of? self return ( APIHelper.valid_type?(value.id, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.map_id, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.site_id, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value., ->(val) { val.instance_of? Float }) and APIHelper.valid_type?(value.type, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.x, ->(val) { val.instance_of? Float }) and APIHelper.valid_type?(value.y, ->(val) { val.instance_of? Float }) ) end return false unless value.instance_of? Hash ( APIHelper.valid_type?(value['id'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['map_id'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['site_id'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['timestamp'], ->(val) { val.instance_of? Float }) and APIHelper.valid_type?(value['type'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['x'], ->(val) { val.instance_of? Float }) and APIHelper.valid_type?(value['y'], ->(val) { val.instance_of? Float }) ) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
290 291 292 293 294 295 296 297 298 299 300 301 |
# File 'lib/mist_api/models/webhook_location_event.rb', line 290 def inspect class_name = self.class.name.split('::').last "<#{class_name} battery_voltage: #{@battery_voltage.inspect}, eddystone_uid_instance:"\ " #{@eddystone_uid_instance.inspect}, eddystone_uid_namespace:"\ " #{@eddystone_uid_namespace.inspect}, eddystone_url_url: #{@eddystone_url_url.inspect},"\ " ibeacon_major: #{@ibeacon_major.inspect}, ibeacon_minor: #{@ibeacon_minor.inspect},"\ " ibeacon_uuid: #{@ibeacon_uuid.inspect}, id: #{@id.inspect}, mac: #{@mac.inspect}, map_id:"\ " #{@map_id.inspect}, mfg_company_id: #{@mfg_company_id.inspect}, mfg_data:"\ " #{@mfg_data.inspect}, name: #{@name.inspect}, site_id: #{@site_id.inspect}, timestamp:"\ " #{@timestamp.inspect}, type: #{@type.inspect}, wifi_beacon_extended_info:"\ " #{@wifi_beacon_extended_info.inspect}, x: #{@x.inspect}, y: #{@y.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
278 279 280 281 282 283 284 285 286 287 |
# File 'lib/mist_api/models/webhook_location_event.rb', line 278 def to_s class_name = self.class.name.split('::').last "<#{class_name} battery_voltage: #{@battery_voltage}, eddystone_uid_instance:"\ " #{@eddystone_uid_instance}, eddystone_uid_namespace: #{@eddystone_uid_namespace},"\ " eddystone_url_url: #{@eddystone_url_url}, ibeacon_major: #{@ibeacon_major}, ibeacon_minor:"\ " #{@ibeacon_minor}, ibeacon_uuid: #{@ibeacon_uuid}, id: #{@id}, mac: #{@mac}, map_id:"\ " #{@map_id}, mfg_company_id: #{@mfg_company_id}, mfg_data: #{@mfg_data}, name: #{@name},"\ " site_id: #{@site_id}, timestamp: #{@timestamp}, type: #{@type}, wifi_beacon_extended_info:"\ " #{@wifi_beacon_extended_info}, x: #{@x}, y: #{@y}>" end |