Class: MistApi::WebhookLocationClientEvent
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- MistApi::WebhookLocationClientEvent
- Defined in:
- lib/mist_api/models/webhook_location_client_event.rb
Overview
WebhookLocationClientEvent Model.
Instance Attribute Summary collapse
-
#mac ⇒ String
TODO: Write general description for this method.
-
#map_id ⇒ UUID | String
TODO: Write general description for this method.
-
#site_id ⇒ UUID | String
TODO: Write general description for this method.
-
#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(mac = SKIP, map_id = SKIP, site_id = SKIP, timestamp = SKIP, type = 'wifi', wifi_beacon_extended_info = SKIP, x = SKIP, y = SKIP) ⇒ WebhookLocationClientEvent
constructor
A new instance of WebhookLocationClientEvent.
-
#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, site_id = SKIP, timestamp = SKIP, type = 'wifi', wifi_beacon_extended_info = SKIP, x = SKIP, y = SKIP) ⇒ WebhookLocationClientEvent
Returns a new instance of WebhookLocationClientEvent.
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/mist_api/models/webhook_location_client_event.rb', line 78 def initialize(mac = SKIP, map_id = SKIP, site_id = SKIP, = SKIP, type = 'wifi', wifi_beacon_extended_info = SKIP, x = SKIP, y = SKIP) @mac = mac unless mac == SKIP @map_id = map_id unless map_id == 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
TODO: Write general description for this method
14 15 16 |
# File 'lib/mist_api/models/webhook_location_client_event.rb', line 14 def mac @mac end |
#map_id ⇒ UUID | String
TODO: Write general description for this method
18 19 20 |
# File 'lib/mist_api/models/webhook_location_client_event.rb', line 18 def map_id @map_id end |
#site_id ⇒ UUID | String
TODO: Write general description for this method
22 23 24 |
# File 'lib/mist_api/models/webhook_location_client_event.rb', line 22 def site_id @site_id end |
#timestamp ⇒ Float
Epoch (seconds)
26 27 28 |
# File 'lib/mist_api/models/webhook_location_client_event.rb', line 26 def @timestamp end |
#type ⇒ String
Epoch (seconds)
30 31 32 |
# File 'lib/mist_api/models/webhook_location_client_event.rb', line 30 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
35 36 37 |
# File 'lib/mist_api/models/webhook_location_client_event.rb', line 35 def wifi_beacon_extended_info @wifi_beacon_extended_info end |
#x ⇒ Float
x, in meter
39 40 41 |
# File 'lib/mist_api/models/webhook_location_client_event.rb', line 39 def x @x end |
#y ⇒ Float
y, in meter
43 44 45 |
# File 'lib/mist_api/models/webhook_location_client_event.rb', line 43 def y @y end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/mist_api/models/webhook_location_client_event.rb', line 95 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 site_id = hash.key?('site_id') ? hash['site_id'] : SKIP = hash.key?('timestamp') ? hash['timestamp'] : SKIP type = hash['type'] ||= 'wifi' # 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. WebhookLocationClientEvent.new(mac, map_id, site_id, , type, wifi_beacon_extended_info, x, y) end |
.names ⇒ Object
A mapping from model property names to API property names.
46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/mist_api/models/webhook_location_client_event.rb', line 46 def self.names @_hash = {} if @_hash.nil? @_hash['mac'] = 'mac' @_hash['map_id'] = 'map_id' @_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
74 75 76 |
# File 'lib/mist_api/models/webhook_location_client_event.rb', line 74 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/mist_api/models/webhook_location_client_event.rb', line 60 def self.optionals %w[ mac map_id site_id timestamp type wifi_beacon_extended_info x y ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
130 131 132 133 134 135 136 |
# File 'lib/mist_api/models/webhook_location_client_event.rb', line 130 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.
147 148 149 150 151 152 153 |
# File 'lib/mist_api/models/webhook_location_client_event.rb', line 147 def inspect class_name = self.class.name.split('::').last "<#{class_name} mac: #{@mac.inspect}, map_id: #{@map_id.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.
139 140 141 142 143 144 |
# File 'lib/mist_api/models/webhook_location_client_event.rb', line 139 def to_s class_name = self.class.name.split('::').last "<#{class_name} mac: #{@mac}, map_id: #{@map_id}, site_id: #{@site_id}, timestamp:"\ " #{@timestamp}, type: #{@type}, wifi_beacon_extended_info: #{@wifi_beacon_extended_info},"\ " x: #{@x}, y: #{@y}>" end |