Class: MistApi::WebhookClientSessionsEvent

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

Overview

WebhookClientSessionsEvent 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(ap = nil, ap_name = nil, band = nil, bssid = nil, client_family = nil, client_manufacture = nil, client_model = nil, client_os = nil, connect = nil, connect_float = nil, disconnect = nil, disconnect_float = nil, duration = nil, mac = nil, next_ap = nil, org_id = nil, rssi = nil, site_id = nil, site_name = nil, ssid = nil, termination_reason = nil, timestamp = nil, version = nil, wlan_id = nil) ⇒ WebhookClientSessionsEvent

Returns a new instance of WebhookClientSessionsEvent.



150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# File 'lib/mist_api/models/webhook_client_sessions_event.rb', line 150

def initialize(ap = nil, ap_name = nil, band = nil, bssid = nil,
               client_family = nil, client_manufacture = nil,
               client_model = nil, client_os = nil, connect = nil,
               connect_float = nil, disconnect = nil,
               disconnect_float = nil, duration = nil, mac = nil,
               next_ap = nil, org_id = nil, rssi = nil, site_id = nil,
               site_name = nil, ssid = nil, termination_reason = nil,
               timestamp = nil, version = nil, wlan_id = nil)
  @ap = ap
  @ap_name = ap_name
  @band = band
  @bssid = bssid
  @client_family = client_family
  @client_manufacture = client_manufacture
  @client_model = client_model
  @client_os = client_os
  @connect = connect
  @connect_float = connect_float
  @disconnect = disconnect
  @disconnect_float = disconnect_float
  @duration = duration
  @mac = mac
  @next_ap = next_ap
  @org_id = org_id
  @rssi = rssi
  @site_id = site_id
  @site_name = site_name
  @ssid = ssid
  @termination_reason = termination_reason
  @timestamp = timestamp
  @version = version
  @wlan_id = wlan_id
end

Instance Attribute Details

#apString

MAC address of the AP the client roamed or disconnected from

Returns:

  • (String)


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

def ap
  @ap
end

#ap_nameString

user-friendly name of the AP the client roamed or disconnected from.

Returns:

  • (String)


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

def ap_name
  @ap_name
end

#bandString

5GHz or 2.4GHz band

Returns:

  • (String)


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

def band
  @band
end

#bssidString

5GHz or 2.4GHz band

Returns:

  • (String)


26
27
28
# File 'lib/mist_api/models/webhook_client_sessions_event.rb', line 26

def bssid
  @bssid
end

#client_familyString

Device family E.g. “Mac”, “iPhone”, “Apple watch”

Returns:

  • (String)


30
31
32
# File 'lib/mist_api/models/webhook_client_sessions_event.rb', line 30

def client_family
  @client_family
end

#client_manufactureString

Device manufacturer E.g. “Apple”

Returns:

  • (String)


34
35
36
# File 'lib/mist_api/models/webhook_client_sessions_event.rb', line 34

def client_manufacture
  @client_manufacture
end

#client_modelString

Device model E.g. “8+”, “XS”

Returns:

  • (String)


38
39
40
# File 'lib/mist_api/models/webhook_client_sessions_event.rb', line 38

def client_model
  @client_model
end

#client_osString

Device operating system E.g. “Mojave”, “Windows 10”, “Linux”

Returns:

  • (String)


42
43
44
# File 'lib/mist_api/models/webhook_client_sessions_event.rb', line 42

def client_os
  @client_os
end

#connectInteger

Time when the user connects

Returns:

  • (Integer)


46
47
48
# File 'lib/mist_api/models/webhook_client_sessions_event.rb', line 46

def connect
  @connect
end

#connect_floatFloat

floating point connect timestamp with millisecond precision

Returns:

  • (Float)


50
51
52
# File 'lib/mist_api/models/webhook_client_sessions_event.rb', line 50

def connect_float
  @connect_float
end

#disconnectInteger

Time when the user disconnects

Returns:

  • (Integer)


54
55
56
# File 'lib/mist_api/models/webhook_client_sessions_event.rb', line 54

def disconnect
  @disconnect
end

#disconnect_floatFloat

floating point disconnect timestamp with millisecond precision

Returns:

  • (Float)


58
59
60
# File 'lib/mist_api/models/webhook_client_sessions_event.rb', line 58

def disconnect_float
  @disconnect_float
end

#durationInteger

Duration of the roamed or complete session indicated by termination_reason field.

Returns:

  • (Integer)


63
64
65
# File 'lib/mist_api/models/webhook_client_sessions_event.rb', line 63

def duration
  @duration
end

#macString

Client’s MAC Address’

Returns:

  • (String)


67
68
69
# File 'lib/mist_api/models/webhook_client_sessions_event.rb', line 67

def mac
  @mac
end

#next_apString

the AP the client has roamed to.

Returns:

  • (String)


71
72
73
# File 'lib/mist_api/models/webhook_client_sessions_event.rb', line 71

def next_ap
  @next_ap
end

#org_idUUID | String

the AP the client has roamed to.

Returns:

  • (UUID | String)


75
76
77
# File 'lib/mist_api/models/webhook_client_sessions_event.rb', line 75

def org_id
  @org_id
end

#rssiFloat

Latest average RSSI before the user disconnects

Returns:

  • (Float)


79
80
81
# File 'lib/mist_api/models/webhook_client_sessions_event.rb', line 79

def rssi
  @rssi
end

#site_idUUID | String

Latest average RSSI before the user disconnects

Returns:

  • (UUID | String)


83
84
85
# File 'lib/mist_api/models/webhook_client_sessions_event.rb', line 83

def site_id
  @site_id
end

#site_nameString

Latest average RSSI before the user disconnects

Returns:

  • (String)


87
88
89
# File 'lib/mist_api/models/webhook_client_sessions_event.rb', line 87

def site_name
  @site_name
end

#ssidString

Latest average RSSI before the user disconnects

Returns:

  • (String)


91
92
93
# File 'lib/mist_api/models/webhook_client_sessions_event.rb', line 91

def ssid
  @ssid
end

#termination_reasonInteger

1 disassociate - when the client disassociates. 2 inactive - when the client is timeout. 3 roamed - when the client is roamed between APs

Returns:

  • (Integer)


96
97
98
# File 'lib/mist_api/models/webhook_client_sessions_event.rb', line 96

def termination_reason
  @termination_reason
end

#timestampFloat

Epoch (seconds)

Returns:

  • (Float)


100
101
102
# File 'lib/mist_api/models/webhook_client_sessions_event.rb', line 100

def timestamp
  @timestamp
end

#versionFloat

schema version of this message

Returns:

  • (Float)


104
105
106
# File 'lib/mist_api/models/webhook_client_sessions_event.rb', line 104

def version
  @version
end

#wlan_idUUID | String

schema version of this message

Returns:

  • (UUID | String)


108
109
110
# File 'lib/mist_api/models/webhook_client_sessions_event.rb', line 108

def wlan_id
  @wlan_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
234
235
236
237
238
239
240
241
242
# File 'lib/mist_api/models/webhook_client_sessions_event.rb', line 185

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  ap = hash.key?('ap') ? hash['ap'] : nil
  ap_name = hash.key?('ap_name') ? hash['ap_name'] : nil
  band = hash.key?('band') ? hash['band'] : nil
  bssid = hash.key?('bssid') ? hash['bssid'] : nil
  client_family = hash.key?('client_family') ? hash['client_family'] : nil
  client_manufacture =
    hash.key?('client_manufacture') ? hash['client_manufacture'] : nil
  client_model = hash.key?('client_model') ? hash['client_model'] : nil
  client_os = hash.key?('client_os') ? hash['client_os'] : nil
  connect = hash.key?('connect') ? hash['connect'] : nil
  connect_float = hash.key?('connect_float') ? hash['connect_float'] : nil
  disconnect = hash.key?('disconnect') ? hash['disconnect'] : nil
  disconnect_float =
    hash.key?('disconnect_float') ? hash['disconnect_float'] : nil
  duration = hash.key?('duration') ? hash['duration'] : nil
  mac = hash.key?('mac') ? hash['mac'] : nil
  next_ap = hash.key?('next_ap') ? hash['next_ap'] : nil
  org_id = hash.key?('org_id') ? hash['org_id'] : nil
  rssi = hash.key?('rssi') ? hash['rssi'] : nil
  site_id = hash.key?('site_id') ? hash['site_id'] : nil
  site_name = hash.key?('site_name') ? hash['site_name'] : nil
  ssid = hash.key?('ssid') ? hash['ssid'] : nil
  termination_reason =
    hash.key?('termination_reason') ? hash['termination_reason'] : nil
  timestamp = hash.key?('timestamp') ? hash['timestamp'] : nil
  version = hash.key?('version') ? hash['version'] : nil
  wlan_id = hash.key?('wlan_id') ? hash['wlan_id'] : nil

  # Create object from extracted values.
  WebhookClientSessionsEvent.new(ap,
                                 ap_name,
                                 band,
                                 bssid,
                                 client_family,
                                 client_manufacture,
                                 client_model,
                                 client_os,
                                 connect,
                                 connect_float,
                                 disconnect,
                                 disconnect_float,
                                 duration,
                                 mac,
                                 next_ap,
                                 org_id,
                                 rssi,
                                 site_id,
                                 site_name,
                                 ssid,
                                 termination_reason,
                                 timestamp,
                                 version,
                                 wlan_id)
end

.namesObject

A mapping from model property names to API property names.



111
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
# File 'lib/mist_api/models/webhook_client_sessions_event.rb', line 111

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['ap'] = 'ap'
  @_hash['ap_name'] = 'ap_name'
  @_hash['band'] = 'band'
  @_hash['bssid'] = 'bssid'
  @_hash['client_family'] = 'client_family'
  @_hash['client_manufacture'] = 'client_manufacture'
  @_hash['client_model'] = 'client_model'
  @_hash['client_os'] = 'client_os'
  @_hash['connect'] = 'connect'
  @_hash['connect_float'] = 'connect_float'
  @_hash['disconnect'] = 'disconnect'
  @_hash['disconnect_float'] = 'disconnect_float'
  @_hash['duration'] = 'duration'
  @_hash['mac'] = 'mac'
  @_hash['next_ap'] = 'next_ap'
  @_hash['org_id'] = 'org_id'
  @_hash['rssi'] = 'rssi'
  @_hash['site_id'] = 'site_id'
  @_hash['site_name'] = 'site_name'
  @_hash['ssid'] = 'ssid'
  @_hash['termination_reason'] = 'termination_reason'
  @_hash['timestamp'] = 'timestamp'
  @_hash['version'] = 'version'
  @_hash['wlan_id'] = 'wlan_id'
  @_hash
end

.nullablesObject

An array for nullable fields



146
147
148
# File 'lib/mist_api/models/webhook_client_sessions_event.rb', line 146

def self.nullables
  []
end

.optionalsObject

An array for optional fields



141
142
143
# File 'lib/mist_api/models/webhook_client_sessions_event.rb', line 141

def self.optionals
  []
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



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
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
# File 'lib/mist_api/models/webhook_client_sessions_event.rb', line 246

def self.validate(value)
  if value.instance_of? self
    return (
      APIHelper.valid_type?(value.ap,
                            ->(val) { val.instance_of? String }) and
        APIHelper.valid_type?(value.ap_name,
                              ->(val) { val.instance_of? String }) and
        APIHelper.valid_type?(value.band,
                              ->(val) { val.instance_of? String }) and
        APIHelper.valid_type?(value.bssid,
                              ->(val) { val.instance_of? String }) and
        APIHelper.valid_type?(value.client_family,
                              ->(val) { val.instance_of? String }) and
        APIHelper.valid_type?(value.client_manufacture,
                              ->(val) { val.instance_of? String }) and
        APIHelper.valid_type?(value.client_model,
                              ->(val) { val.instance_of? String }) and
        APIHelper.valid_type?(value.client_os,
                              ->(val) { val.instance_of? String }) and
        APIHelper.valid_type?(value.connect,
                              ->(val) { val.instance_of? Integer }) and
        APIHelper.valid_type?(value.connect_float,
                              ->(val) { val.instance_of? Float }) and
        APIHelper.valid_type?(value.disconnect,
                              ->(val) { val.instance_of? Integer }) and
        APIHelper.valid_type?(value.disconnect_float,
                              ->(val) { val.instance_of? Float }) and
        APIHelper.valid_type?(value.duration,
                              ->(val) { val.instance_of? Integer }) and
        APIHelper.valid_type?(value.mac,
                              ->(val) { val.instance_of? String }) and
        APIHelper.valid_type?(value.next_ap,
                              ->(val) { val.instance_of? String }) and
        APIHelper.valid_type?(value.org_id,
                              ->(val) { val.instance_of? String }) and
        APIHelper.valid_type?(value.rssi,
                              ->(val) { val.instance_of? Float }) and
        APIHelper.valid_type?(value.site_id,
                              ->(val) { val.instance_of? String }) and
        APIHelper.valid_type?(value.site_name,
                              ->(val) { val.instance_of? String }) and
        APIHelper.valid_type?(value.ssid,
                              ->(val) { val.instance_of? String }) and
        APIHelper.valid_type?(value.termination_reason,
                              ->(val) { val.instance_of? Integer }) and
        APIHelper.valid_type?(value.timestamp,
                              ->(val) { val.instance_of? Float }) and
        APIHelper.valid_type?(value.version,
                              ->(val) { val.instance_of? Float }) and
        APIHelper.valid_type?(value.wlan_id,
                              ->(val) { val.instance_of? String })
    )
  end

  return false unless value.instance_of? Hash

  (
    APIHelper.valid_type?(value['ap'],
                          ->(val) { val.instance_of? String }) and
      APIHelper.valid_type?(value['ap_name'],
                            ->(val) { val.instance_of? String }) and
      APIHelper.valid_type?(value['band'],
                            ->(val) { val.instance_of? String }) and
      APIHelper.valid_type?(value['bssid'],
                            ->(val) { val.instance_of? String }) and
      APIHelper.valid_type?(value['client_family'],
                            ->(val) { val.instance_of? String }) and
      APIHelper.valid_type?(value['client_manufacture'],
                            ->(val) { val.instance_of? String }) and
      APIHelper.valid_type?(value['client_model'],
                            ->(val) { val.instance_of? String }) and
      APIHelper.valid_type?(value['client_os'],
                            ->(val) { val.instance_of? String }) and
      APIHelper.valid_type?(value['connect'],
                            ->(val) { val.instance_of? Integer }) and
      APIHelper.valid_type?(value['connect_float'],
                            ->(val) { val.instance_of? Float }) and
      APIHelper.valid_type?(value['disconnect'],
                            ->(val) { val.instance_of? Integer }) and
      APIHelper.valid_type?(value['disconnect_float'],
                            ->(val) { val.instance_of? Float }) and
      APIHelper.valid_type?(value['duration'],
                            ->(val) { val.instance_of? Integer }) and
      APIHelper.valid_type?(value['mac'],
                            ->(val) { val.instance_of? String }) and
      APIHelper.valid_type?(value['next_ap'],
                            ->(val) { val.instance_of? String }) and
      APIHelper.valid_type?(value['org_id'],
                            ->(val) { val.instance_of? String }) and
      APIHelper.valid_type?(value['rssi'],
                            ->(val) { val.instance_of? Float }) and
      APIHelper.valid_type?(value['site_id'],
                            ->(val) { val.instance_of? String }) and
      APIHelper.valid_type?(value['site_name'],
                            ->(val) { val.instance_of? String }) and
      APIHelper.valid_type?(value['ssid'],
                            ->(val) { val.instance_of? String }) and
      APIHelper.valid_type?(value['termination_reason'],
                            ->(val) { val.instance_of? Integer }) and
      APIHelper.valid_type?(value['timestamp'],
                            ->(val) { val.instance_of? Float }) and
      APIHelper.valid_type?(value['version'],
                            ->(val) { val.instance_of? Float }) and
      APIHelper.valid_type?(value['wlan_id'],
                            ->(val) { val.instance_of? String })
  )
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



368
369
370
371
372
373
374
375
376
377
378
379
380
# File 'lib/mist_api/models/webhook_client_sessions_event.rb', line 368

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} ap: #{@ap.inspect}, ap_name: #{@ap_name.inspect}, band: #{@band.inspect},"\
  " bssid: #{@bssid.inspect}, client_family: #{@client_family.inspect}, client_manufacture:"\
  " #{@client_manufacture.inspect}, client_model: #{@client_model.inspect}, client_os:"\
  " #{@client_os.inspect}, connect: #{@connect.inspect}, connect_float:"\
  " #{@connect_float.inspect}, disconnect: #{@disconnect.inspect}, disconnect_float:"\
  " #{@disconnect_float.inspect}, duration: #{@duration.inspect}, mac: #{@mac.inspect},"\
  " next_ap: #{@next_ap.inspect}, org_id: #{@org_id.inspect}, rssi: #{@rssi.inspect}, site_id:"\
  " #{@site_id.inspect}, site_name: #{@site_name.inspect}, ssid: #{@ssid.inspect},"\
  " termination_reason: #{@termination_reason.inspect}, timestamp: #{@timestamp.inspect},"\
  " version: #{@version.inspect}, wlan_id: #{@wlan_id.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



355
356
357
358
359
360
361
362
363
364
365
# File 'lib/mist_api/models/webhook_client_sessions_event.rb', line 355

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} ap: #{@ap}, ap_name: #{@ap_name}, band: #{@band}, bssid: #{@bssid},"\
  " client_family: #{@client_family}, client_manufacture: #{@client_manufacture},"\
  " client_model: #{@client_model}, client_os: #{@client_os}, connect: #{@connect},"\
  " connect_float: #{@connect_float}, disconnect: #{@disconnect}, disconnect_float:"\
  " #{@disconnect_float}, duration: #{@duration}, mac: #{@mac}, next_ap: #{@next_ap}, org_id:"\
  " #{@org_id}, rssi: #{@rssi}, site_id: #{@site_id}, site_name: #{@site_name}, ssid:"\
  " #{@ssid}, termination_reason: #{@termination_reason}, timestamp: #{@timestamp}, version:"\
  " #{@version}, wlan_id: #{@wlan_id}>"
end