Class: MistApi::WebhookLocationCentrakEvent
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- MistApi::WebhookLocationCentrakEvent
- Defined in:
- lib/mist_api/models/webhook_location_centrak_event.rb
Overview
WebhookLocationCentrakEvent Model.
Instance Attribute Summary collapse
-
#mac ⇒ String
MAC address of the device.
-
#map_id ⇒ String
Map id.
-
#mfg_company_id ⇒ Integer
Optional, BLE manufacturing company ID.
-
#mfg_data ⇒ String
Optional, BLE manufacturing data in hex byte-string format (i.e. “112233AABBCC”).
-
#site_id ⇒ UUID | String
Optional, BLE manufacturing data in hex byte-string format (i.e. “112233AABBCC”).
-
#timestamp ⇒ Float
Epoch (seconds).
-
#type ⇒ WebhookLocationCentrakEventTypeEnum
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(mac = SKIP, map_id = SKIP, mfg_company_id = SKIP, mfg_data = SKIP, site_id = SKIP, timestamp = SKIP, type = SKIP, wifi_beacon_extended_info = SKIP, x = SKIP, y = SKIP) ⇒ WebhookLocationCentrakEvent
constructor
A new instance of WebhookLocationCentrakEvent.
-
#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(mac = SKIP, map_id = SKIP, mfg_company_id = SKIP, mfg_data = SKIP, site_id = SKIP, timestamp = SKIP, type = SKIP, wifi_beacon_extended_info = SKIP, x = SKIP, y = SKIP) ⇒ WebhookLocationCentrakEvent
Returns a new instance of WebhookLocationCentrakEvent.
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/mist_api/models/webhook_location_centrak_event.rb', line 92 def initialize(mac = SKIP, map_id = SKIP, mfg_company_id = SKIP, mfg_data = SKIP, site_id = SKIP, = SKIP, type = SKIP, wifi_beacon_extended_info = SKIP, x = SKIP, y = 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 @site_id = site_id unless site_id == SKIP @timestamp = unless == SKIP @type = type unless type == SKIP unless wifi_beacon_extended_info == SKIP @wifi_beacon_extended_info = wifi_beacon_extended_info end @x = x unless x == SKIP @y = y unless y == SKIP end |
Instance Attribute Details
#mac ⇒ String
MAC address of the device
14 15 16 |
# File 'lib/mist_api/models/webhook_location_centrak_event.rb', line 14 def mac @mac end |
#map_id ⇒ String
Map id
18 19 20 |
# File 'lib/mist_api/models/webhook_location_centrak_event.rb', line 18 def map_id @map_id end |
#mfg_company_id ⇒ Integer
Optional, BLE manufacturing company ID
22 23 24 |
# File 'lib/mist_api/models/webhook_location_centrak_event.rb', line 22 def mfg_company_id @mfg_company_id end |
#mfg_data ⇒ String
Optional, BLE manufacturing data in hex byte-string format (i.e. “112233AABBCC”)
27 28 29 |
# File 'lib/mist_api/models/webhook_location_centrak_event.rb', line 27 def mfg_data @mfg_data end |
#site_id ⇒ UUID | String
Optional, BLE manufacturing data in hex byte-string format (i.e. “112233AABBCC”)
32 33 34 |
# File 'lib/mist_api/models/webhook_location_centrak_event.rb', line 32 def site_id @site_id end |
#timestamp ⇒ Float
Epoch (seconds)
36 37 38 |
# File 'lib/mist_api/models/webhook_location_centrak_event.rb', line 36 def @timestamp end |
#type ⇒ WebhookLocationCentrakEventTypeEnum
Epoch (seconds)
40 41 42 |
# File 'lib/mist_api/models/webhook_location_centrak_event.rb', line 40 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
45 46 47 |
# File 'lib/mist_api/models/webhook_location_centrak_event.rb', line 45 def wifi_beacon_extended_info @wifi_beacon_extended_info end |
#x ⇒ Float
x, in meter
49 50 51 |
# File 'lib/mist_api/models/webhook_location_centrak_event.rb', line 49 def x @x end |
#y ⇒ Float
y, in meter
53 54 55 |
# File 'lib/mist_api/models/webhook_location_centrak_event.rb', line 53 def y @y end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
# File 'lib/mist_api/models/webhook_location_centrak_event.rb', line 112 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. 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 site_id = hash.key?('site_id') ? hash['site_id'] : SKIP = hash.key?('timestamp') ? hash['timestamp'] : SKIP type = hash.key?('type') ? hash['type'] : 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') x = hash.key?('x') ? hash['x'] : SKIP y = hash.key?('y') ? hash['y'] : SKIP # Create object from extracted values. WebhookLocationCentrakEvent.new(mac, map_id, mfg_company_id, mfg_data, site_id, , type, wifi_beacon_extended_info, x, y) end |
.names ⇒ Object
A mapping from model property names to API property names.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/mist_api/models/webhook_location_centrak_event.rb', line 56 def self.names @_hash = {} if @_hash.nil? @_hash['mac'] = 'mac' @_hash['map_id'] = 'map_id' @_hash['mfg_company_id'] = 'mfg_company_id' @_hash['mfg_data'] = 'mfg_data' @_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
88 89 90 |
# File 'lib/mist_api/models/webhook_location_centrak_event.rb', line 88 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/mist_api/models/webhook_location_centrak_event.rb', line 72 def self.optionals %w[ mac map_id mfg_company_id mfg_data site_id timestamp type wifi_beacon_extended_info x y ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
152 153 154 155 156 157 158 |
# File 'lib/mist_api/models/webhook_location_centrak_event.rb', line 152 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.
169 170 171 172 173 174 175 |
# File 'lib/mist_api/models/webhook_location_centrak_event.rb', line 169 def inspect class_name = self.class.name.split('::').last "<#{class_name} mac: #{@mac.inspect}, map_id: #{@map_id.inspect}, mfg_company_id:"\ " #{@mfg_company_id.inspect}, mfg_data: #{@mfg_data.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.
161 162 163 164 165 166 |
# File 'lib/mist_api/models/webhook_location_centrak_event.rb', line 161 def to_s class_name = self.class.name.split('::').last "<#{class_name} mac: #{@mac}, map_id: #{@map_id}, mfg_company_id: #{@mfg_company_id},"\ " mfg_data: #{@mfg_data}, site_id: #{@site_id}, timestamp: #{@timestamp}, type: #{@type},"\ " wifi_beacon_extended_info: #{@wifi_beacon_extended_info}, x: #{@x}, y: #{@y}>" end |