Class: MistApi::WebhookWifiConnRawEvent

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

Overview

WebhookWifiConnRawEvent 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_id = SKIP, ap_loc = SKIP, client_id = SKIP, connected_site = SKIP, extended_info_list = SKIP, map_id = SKIP, org_id = SKIP, packets = SKIP, site_id = SKIP) ⇒ WebhookWifiConnRawEvent

Returns a new instance of WebhookWifiConnRawEvent.



87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/mist_api/models/webhook_wifi_conn_raw_event.rb', line 87

def initialize(ap_id = SKIP, ap_loc = SKIP, client_id = SKIP,
               connected_site = SKIP, extended_info_list = SKIP,
               map_id = SKIP, org_id = SKIP, packets = SKIP, site_id = SKIP)
  @ap_id = ap_id unless ap_id == SKIP
  @ap_loc = ap_loc unless ap_loc == SKIP
  @client_id = client_id unless client_id == SKIP
  @connected_site = connected_site unless connected_site == SKIP
  @extended_info_list = extended_info_list unless extended_info_list == SKIP
  @map_id = map_id unless map_id == SKIP
  @org_id = org_id unless org_id == SKIP
  @packets = packets unless packets == SKIP
  @site_id = site_id unless site_id == SKIP
end

Instance Attribute Details

#ap_idString

TODO: Write general description for this method

Returns:

  • (String)


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

def ap_id
  @ap_id
end

#ap_locArray[Float]

optional, coordinates (if any) of reporting AP (updated once in 60s per client)

Returns:

  • (Array[Float])


19
20
21
# File 'lib/mist_api/models/webhook_wifi_conn_raw_event.rb', line 19

def ap_loc
  @ap_loc
end

#client_idString

optional, coordinates (if any) of reporting AP (updated once in 60s per client)

Returns:

  • (String)


24
25
26
# File 'lib/mist_api/models/webhook_wifi_conn_raw_event.rb', line 24

def client_id
  @client_id
end

#connected_siteTrueClass | FalseClass

optional, coordinates (if any) of reporting AP (updated once in 60s per client)

Returns:

  • (TrueClass | FalseClass)


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

def connected_site
  @connected_site
end

#extended_info_listArray[WebhookWifiConnRawEventExtendedInfo]

optional, list of specific telemetry packets emited by certain wifi tags (Eg. Centrak)



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

def extended_info_list
  @extended_info_list
end

#map_idUUID | String

Unique ID of the object instance in the Mist Organization

Returns:

  • (UUID | String)


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

def map_id
  @map_id
end

#org_idUUID | String

Unique ID of the object instance in the Mist Organization

Returns:

  • (UUID | String)


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

def org_id
  @org_id
end

#packetsArray[WebhookWifiConnRawEventPacket]

Unique ID of the object instance in the Mist Organization

Returns:



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

def packets
  @packets
end

#site_idUUID | String

Unique ID of the object instance in the Mist Organization

Returns:

  • (UUID | String)


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

def site_id
  @site_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/mist_api/models/webhook_wifi_conn_raw_event.rb', line 102

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  ap_id = hash.key?('ap_id') ? hash['ap_id'] : SKIP
  ap_loc = hash.key?('ap_loc') ? hash['ap_loc'] : SKIP
  client_id = hash.key?('client_id') ? hash['client_id'] : SKIP
  connected_site =
    hash.key?('connected_site') ? hash['connected_site'] : SKIP
  # Parameter is an array, so we need to iterate through it
  extended_info_list = nil
  unless hash['extended_info_list'].nil?
    extended_info_list = []
    hash['extended_info_list'].each do |structure|
      extended_info_list << (WebhookWifiConnRawEventExtendedInfo.from_hash(structure) if structure)
    end
  end

  extended_info_list = SKIP unless hash.key?('extended_info_list')
  map_id = hash.key?('map_id') ? hash['map_id'] : SKIP
  org_id = hash.key?('org_id') ? hash['org_id'] : SKIP
  # Parameter is an array, so we need to iterate through it
  packets = nil
  unless hash['packets'].nil?
    packets = []
    hash['packets'].each do |structure|
      packets << (WebhookWifiConnRawEventPacket.from_hash(structure) if structure)
    end
  end

  packets = SKIP unless hash.key?('packets')
  site_id = hash.key?('site_id') ? hash['site_id'] : SKIP

  # Create object from extracted values.
  WebhookWifiConnRawEvent.new(ap_id,
                              ap_loc,
                              client_id,
                              connected_site,
                              extended_info_list,
                              map_id,
                              org_id,
                              packets,
                              site_id)
end

.namesObject

A mapping from model property names to API property names.



53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/mist_api/models/webhook_wifi_conn_raw_event.rb', line 53

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['ap_id'] = 'ap_id'
  @_hash['ap_loc'] = 'ap_loc'
  @_hash['client_id'] = 'client_id'
  @_hash['connected_site'] = 'connected_site'
  @_hash['extended_info_list'] = 'extended_info_list'
  @_hash['map_id'] = 'map_id'
  @_hash['org_id'] = 'org_id'
  @_hash['packets'] = 'packets'
  @_hash['site_id'] = 'site_id'
  @_hash
end

.nullablesObject

An array for nullable fields



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/mist_api/models/webhook_wifi_conn_raw_event.rb', line 68

def self.optionals
  %w[
    ap_id
    ap_loc
    client_id
    connected_site
    extended_info_list
    map_id
    org_id
    packets
    site_id
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



149
150
151
152
153
154
155
# File 'lib/mist_api/models/webhook_wifi_conn_raw_event.rb', line 149

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.



166
167
168
169
170
171
172
# File 'lib/mist_api/models/webhook_wifi_conn_raw_event.rb', line 166

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} ap_id: #{@ap_id.inspect}, ap_loc: #{@ap_loc.inspect}, client_id:"\
  " #{@client_id.inspect}, connected_site: #{@connected_site.inspect}, extended_info_list:"\
  " #{@extended_info_list.inspect}, map_id: #{@map_id.inspect}, org_id: #{@org_id.inspect},"\
  " packets: #{@packets.inspect}, site_id: #{@site_id.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



158
159
160
161
162
163
# File 'lib/mist_api/models/webhook_wifi_conn_raw_event.rb', line 158

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} ap_id: #{@ap_id}, ap_loc: #{@ap_loc}, client_id: #{@client_id},"\
  " connected_site: #{@connected_site}, extended_info_list: #{@extended_info_list}, map_id:"\
  " #{@map_id}, org_id: #{@org_id}, packets: #{@packets}, site_id: #{@site_id}>"
end