Class: MistApi::WebhookWifiConnRaw

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

Overview

Sample of the ‘wifi-conn-raw` webhook payload. This webhook topic provides raw data from packets emitted by connected devices. Raw data webhooks are a special subset of webhooks that provide insight into raw data packets emitted by a client, identified by their advertising MAC address (assets, discovered ble, connected wifi, unconnected wifi). The data that client raw data webhooks encompasses are reporting AP information, RSSI Data, and any special packets/telemetry packets that the client may emit. Note that client raw webhooks are the raw data coming from the client and do not contain the X,Y location data of the client. In order to get the location data for a client please see our location webhooks. Clients can be identified uniquely across these client raw data topics and location webhook topic using MAC address as the Unique identifier (client identifier).

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(events = nil) ⇒ WebhookWifiConnRaw

Returns a new instance of WebhookWifiConnRaw.



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

def initialize(events = nil)
  @events = events
  @topic = 'wifi-conn-raw'
end

Instance Attribute Details

#eventsArray[WebhookWifiConnRawEvent]

TODO: Write general description for this method

Returns:



25
26
27
# File 'lib/mist_api/models/webhook_wifi_conn_raw.rb', line 25

def events
  @events
end

#topicString (readonly)

enum: ‘wifi-conn-raw`

Returns:

  • (String)


29
30
31
# File 'lib/mist_api/models/webhook_wifi_conn_raw.rb', line 29

def topic
  @topic
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/mist_api/models/webhook_wifi_conn_raw.rb', line 55

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  # Parameter is an array, so we need to iterate through it
  events = nil
  unless hash['events'].nil?
    events = []
    hash['events'].each do |structure|
      events << (WebhookWifiConnRawEvent.from_hash(structure) if structure)
    end
  end

  events = nil unless hash.key?('events')

  # Create object from extracted values.
  WebhookWifiConnRaw.new(events)
end

.namesObject

A mapping from model property names to API property names.



32
33
34
35
36
37
# File 'lib/mist_api/models/webhook_wifi_conn_raw.rb', line 32

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['events'] = 'events'
  @_hash['topic'] = 'topic'
  @_hash
end

.nullablesObject

An array for nullable fields



45
46
47
# File 'lib/mist_api/models/webhook_wifi_conn_raw.rb', line 45

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  []
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/mist_api/models/webhook_wifi_conn_raw.rb', line 76

def self.validate(value)
  if value.instance_of? self
    return (
      APIHelper.valid_type?(value.events,
                            ->(val) { WebhookWifiConnRawEvent.validate(val) },
                            is_model_hash: true,
                            is_inner_model_hash: true) and
        APIHelper.valid_type?(value.topic,
                              ->(val) { val.instance_of? String })
    )
  end

  return false unless value.instance_of? Hash

  (
    APIHelper.valid_type?(value['events'],
                          ->(val) { WebhookWifiConnRawEvent.validate(val) },
                          is_model_hash: true,
                          is_inner_model_hash: true) and
      APIHelper.valid_type?(value['topic'],
                            ->(val) { val.instance_of? String })
  )
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



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

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} events: #{@events.inspect}, topic: #{@topic.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



101
102
103
104
# File 'lib/mist_api/models/webhook_wifi_conn_raw.rb', line 101

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} events: #{@events}, topic: #{@topic}>"
end