Class: MistApi::WebhookLocationCentrakEvent

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/mist_api/models/webhook_location_centrak_event.rb

Overview

WebhookLocationCentrakEvent Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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, timestamp = 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 = timestamp unless timestamp == 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

#macString

MAC address of the device

Returns:

  • (String)


14
15
16
# File 'lib/mist_api/models/webhook_location_centrak_event.rb', line 14

def mac
  @mac
end

#map_idString

Map id

Returns:

  • (String)


18
19
20
# File 'lib/mist_api/models/webhook_location_centrak_event.rb', line 18

def map_id
  @map_id
end

#mfg_company_idInteger

Optional, BLE manufacturing company ID

Returns:

  • (Integer)


22
23
24
# File 'lib/mist_api/models/webhook_location_centrak_event.rb', line 22

def mfg_company_id
  @mfg_company_id
end

#mfg_dataString

Optional, BLE manufacturing data in hex byte-string format (i.e. “112233AABBCC”)

Returns:

  • (String)


27
28
29
# File 'lib/mist_api/models/webhook_location_centrak_event.rb', line 27

def mfg_data
  @mfg_data
end

#site_idUUID | String

Optional, BLE manufacturing data in hex byte-string format (i.e. “112233AABBCC”)

Returns:

  • (UUID | String)


32
33
34
# File 'lib/mist_api/models/webhook_location_centrak_event.rb', line 32

def site_id
  @site_id
end

#timestampFloat

Epoch (seconds)

Returns:

  • (Float)


36
37
38
# File 'lib/mist_api/models/webhook_location_centrak_event.rb', line 36

def timestamp
  @timestamp
end

#typeWebhookLocationCentrakEventTypeEnum

Epoch (seconds)



40
41
42
# File 'lib/mist_api/models/webhook_location_centrak_event.rb', line 40

def type
  @type
end

#wifi_beacon_extended_infoArray[WifiBeaconExtendedInfoItems]

Optional, list of extended beacon info packets heard from the client, frame and sequence control included with the payload

Returns:



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

#xFloat

x, in meter

Returns:

  • (Float)


49
50
51
# File 'lib/mist_api/models/webhook_location_centrak_event.rb', line 49

def x
  @x
end

#yFloat

y, in meter

Returns:

  • (Float)


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
  timestamp = 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,
                                  timestamp,
                                  type,
                                  wifi_beacon_extended_info,
                                  x,
                                  y)
end

.namesObject

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

.nullablesObject

An array for nullable fields



88
89
90
# File 'lib/mist_api/models/webhook_location_centrak_event.rb', line 88

def self.nullables
  []
end

.optionalsObject

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.

Parameters:



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

#inspectObject

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_sObject

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