Class: MistApi::StatsZone

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

Overview

Zone statistics

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(id = nil, map_id = nil, name = nil, assets_wait = SKIP, clients_wait = SKIP, created_time = SKIP, discovered_assets_wait = SKIP, modified_time = SKIP, num_assets = SKIP, num_clients = SKIP, num_discovered_assets = SKIP, num_sdkclients = SKIP, num_unconnected_clients = SKIP, occupancy_limit = SKIP, org_id = SKIP, sdkclients_wait = SKIP, site_id = SKIP, unconnected_clients_wait = SKIP, vertices = SKIP, vertices_m = SKIP) ⇒ StatsZone

Returns a new instance of StatsZone.



148
149
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
# File 'lib/mist_api/models/stats_zone.rb', line 148

def initialize(id = nil, map_id = nil, name = nil, assets_wait = SKIP,
               clients_wait = SKIP, created_time = SKIP,
               discovered_assets_wait = SKIP, modified_time = SKIP,
               num_assets = SKIP, num_clients = SKIP,
               num_discovered_assets = SKIP, num_sdkclients = SKIP,
               num_unconnected_clients = SKIP, occupancy_limit = SKIP,
               org_id = SKIP, sdkclients_wait = SKIP, site_id = SKIP,
               unconnected_clients_wait = SKIP, vertices = SKIP,
               vertices_m = SKIP)
  @assets_wait = assets_wait unless assets_wait == SKIP
  @clients_wait = clients_wait unless clients_wait == SKIP
  @created_time = created_time unless created_time == SKIP
  @discovered_assets_wait = discovered_assets_wait unless discovered_assets_wait == SKIP
  @id = id
  @map_id = map_id
  @modified_time = modified_time unless modified_time == SKIP
  @name = name
  @num_assets = num_assets unless num_assets == SKIP
  @num_clients = num_clients unless num_clients == SKIP
  @num_discovered_assets = num_discovered_assets unless num_discovered_assets == SKIP
  @num_sdkclients = num_sdkclients unless num_sdkclients == SKIP
  @num_unconnected_clients = num_unconnected_clients unless num_unconnected_clients == SKIP
  @occupancy_limit = occupancy_limit unless occupancy_limit == SKIP
  @org_id = org_id unless org_id == SKIP
  @sdkclients_wait = sdkclients_wait unless sdkclients_wait == SKIP
  @site_id = site_id unless site_id == SKIP
  @unconnected_clients_wait = unconnected_clients_wait unless unconnected_clients_wait == SKIP
  @vertices = vertices unless vertices == SKIP
  @vertices_m = vertices_m unless vertices_m == SKIP
end

Instance Attribute Details

#assets_waitStatsZoneAssetsWaits

BLE asset wait time right now



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

def assets_wait
  @assets_wait
end

#clients_waitStatsZoneClientsWaits

Client wait time right now



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

def clients_wait
  @clients_wait
end

#created_timeFloat

When the object has been created, in epoch

Returns:

  • (Float)


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

def created_time
  @created_time
end

#discovered_assets_waitStatsZoneDiscoveredAssetsWaits

Discovered asset wait time right now



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

def discovered_assets_wait
  @discovered_assets_wait
end

#idUUID | String

Unique ID of the object instance in the Mist Organization

Returns:

  • (UUID | String)


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

def id
  @id
end

#map_idUUID | String

Map_id of the zone

Returns:

  • (UUID | String)


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

def map_id
  @map_id
end

#modified_timeFloat

When the object has been modified for the last time, in epoch

Returns:

  • (Float)


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

def modified_time
  @modified_time
end

#nameString

Name of the zone

Returns:

  • (String)


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

def name
  @name
end

#num_assetsInteger

Number of assets

Returns:

  • (Integer)


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

def num_assets
  @num_assets
end

#num_clientsInteger

Number of Wi-Fi clients (unconnected + connected)

Returns:

  • (Integer)


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

def num_clients
  @num_clients
end

#num_discovered_assetsInteger

Number of discoveredassets

Returns:

  • (Integer)


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

def num_discovered_assets
  @num_discovered_assets
end

#num_sdkclientsInteger

Number of sdk clients

Returns:

  • (Integer)


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

def num_sdkclients
  @num_sdkclients
end

#num_unconnected_clientsInteger

Number of unconnected Wi-Fi clients

Returns:

  • (Integer)


62
63
64
# File 'lib/mist_api/models/stats_zone.rb', line 62

def num_unconnected_clients
  @num_unconnected_clients
end

#occupancy_limitInteger

Number of unconnected Wi-Fi clients

Returns:

  • (Integer)


66
67
68
# File 'lib/mist_api/models/stats_zone.rb', line 66

def occupancy_limit
  @occupancy_limit
end

#org_idUUID | String

Number of unconnected Wi-Fi clients

Returns:

  • (UUID | String)


70
71
72
# File 'lib/mist_api/models/stats_zone.rb', line 70

def org_id
  @org_id
end

#sdkclients_waitStatsZoneSdkclientsWaits

SDK client wait time right now



74
75
76
# File 'lib/mist_api/models/stats_zone.rb', line 74

def sdkclients_wait
  @sdkclients_wait
end

#site_idUUID | String

SDK client wait time right now

Returns:

  • (UUID | String)


78
79
80
# File 'lib/mist_api/models/stats_zone.rb', line 78

def site_id
  @site_id
end

#unconnected_clients_waitStatsZoneUnconnectedClientsWaits

Unconnected Wi-Fi client wait time right now



82
83
84
# File 'lib/mist_api/models/stats_zone.rb', line 82

def unconnected_clients_wait
  @unconnected_clients_wait
end

#verticesArray[ZoneVertex]

Vertices used to define an area. It’s assumed that the last point connects to the first point and forms an closed area

Returns:



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

def vertices
  @vertices
end

#vertices_mArray[ZoneVertexM]

Vertices used to define an area. It’s assumed that the last point connects to the first point and forms an closed area

Returns:



92
93
94
# File 'lib/mist_api/models/stats_zone.rb', line 92

def vertices_m
  @vertices_m
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



180
181
182
183
184
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
243
244
245
246
247
248
249
250
251
252
253
# File 'lib/mist_api/models/stats_zone.rb', line 180

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  id = hash.key?('id') ? hash['id'] : nil
  map_id = hash.key?('map_id') ? hash['map_id'] : nil
  name = hash.key?('name') ? hash['name'] : nil
  assets_wait = StatsZoneAssetsWaits.from_hash(hash['assets_wait']) if hash['assets_wait']
  clients_wait = StatsZoneClientsWaits.from_hash(hash['clients_wait']) if hash['clients_wait']
  created_time = hash.key?('created_time') ? hash['created_time'] : SKIP
  if hash['discovered_assets_wait']
    discovered_assets_wait = StatsZoneDiscoveredAssetsWaits.from_hash(hash['discovered_assets_wait'])
  end
  modified_time = hash.key?('modified_time') ? hash['modified_time'] : SKIP
  num_assets = hash.key?('num_assets') ? hash['num_assets'] : SKIP
  num_clients = hash.key?('num_clients') ? hash['num_clients'] : SKIP
  num_discovered_assets =
    hash.key?('num_discovered_assets') ? hash['num_discovered_assets'] : SKIP
  num_sdkclients =
    hash.key?('num_sdkclients') ? hash['num_sdkclients'] : SKIP
  num_unconnected_clients =
    hash.key?('num_unconnected_clients') ? hash['num_unconnected_clients'] : SKIP
  occupancy_limit =
    hash.key?('occupancy_limit') ? hash['occupancy_limit'] : SKIP
  org_id = hash.key?('org_id') ? hash['org_id'] : SKIP
  sdkclients_wait = StatsZoneSdkclientsWaits.from_hash(hash['sdkclients_wait']) if
    hash['sdkclients_wait']
  site_id = hash.key?('site_id') ? hash['site_id'] : SKIP
  if hash['unconnected_clients_wait']
    unconnected_clients_wait = StatsZoneUnconnectedClientsWaits.from_hash(hash['unconnected_clients_wait'])
  end
  # Parameter is an array, so we need to iterate through it
  vertices = nil
  unless hash['vertices'].nil?
    vertices = []
    hash['vertices'].each do |structure|
      vertices << (ZoneVertex.from_hash(structure) if structure)
    end
  end

  vertices = SKIP unless hash.key?('vertices')
  # Parameter is an array, so we need to iterate through it
  vertices_m = nil
  unless hash['vertices_m'].nil?
    vertices_m = []
    hash['vertices_m'].each do |structure|
      vertices_m << (ZoneVertexM.from_hash(structure) if structure)
    end
  end

  vertices_m = SKIP unless hash.key?('vertices_m')

  # Create object from extracted values.
  StatsZone.new(id,
                map_id,
                name,
                assets_wait,
                clients_wait,
                created_time,
                discovered_assets_wait,
                modified_time,
                num_assets,
                num_clients,
                num_discovered_assets,
                num_sdkclients,
                num_unconnected_clients,
                occupancy_limit,
                org_id,
                sdkclients_wait,
                site_id,
                unconnected_clients_wait,
                vertices,
                vertices_m)
end

.namesObject

A mapping from model property names to API property names.



95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/mist_api/models/stats_zone.rb', line 95

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['assets_wait'] = 'assets_wait'
  @_hash['clients_wait'] = 'clients_wait'
  @_hash['created_time'] = 'created_time'
  @_hash['discovered_assets_wait'] = 'discovered_assets_wait'
  @_hash['id'] = 'id'
  @_hash['map_id'] = 'map_id'
  @_hash['modified_time'] = 'modified_time'
  @_hash['name'] = 'name'
  @_hash['num_assets'] = 'num_assets'
  @_hash['num_clients'] = 'num_clients'
  @_hash['num_discovered_assets'] = 'num_discovered_assets'
  @_hash['num_sdkclients'] = 'num_sdkclients'
  @_hash['num_unconnected_clients'] = 'num_unconnected_clients'
  @_hash['occupancy_limit'] = 'occupancy_limit'
  @_hash['org_id'] = 'org_id'
  @_hash['sdkclients_wait'] = 'sdkclients_wait'
  @_hash['site_id'] = 'site_id'
  @_hash['unconnected_clients_wait'] = 'unconnected_clients_wait'
  @_hash['vertices'] = 'vertices'
  @_hash['vertices_m'] = 'vertices_m'
  @_hash
end

.nullablesObject

An array for nullable fields



144
145
146
# File 'lib/mist_api/models/stats_zone.rb', line 144

def self.nullables
  []
end

.optionalsObject

An array for optional fields



121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/mist_api/models/stats_zone.rb', line 121

def self.optionals
  %w[
    assets_wait
    clients_wait
    created_time
    discovered_assets_wait
    modified_time
    num_assets
    num_clients
    num_discovered_assets
    num_sdkclients
    num_unconnected_clients
    occupancy_limit
    org_id
    sdkclients_wait
    site_id
    unconnected_clients_wait
    vertices
    vertices_m
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



269
270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'lib/mist_api/models/stats_zone.rb', line 269

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} assets_wait: #{@assets_wait.inspect}, clients_wait:"\
  " #{@clients_wait.inspect}, created_time: #{@created_time.inspect}, discovered_assets_wait:"\
  " #{@discovered_assets_wait.inspect}, id: #{@id.inspect}, map_id: #{@map_id.inspect},"\
  " modified_time: #{@modified_time.inspect}, name: #{@name.inspect}, num_assets:"\
  " #{@num_assets.inspect}, num_clients: #{@num_clients.inspect}, num_discovered_assets:"\
  " #{@num_discovered_assets.inspect}, num_sdkclients: #{@num_sdkclients.inspect},"\
  " num_unconnected_clients: #{@num_unconnected_clients.inspect}, occupancy_limit:"\
  " #{@occupancy_limit.inspect}, org_id: #{@org_id.inspect}, sdkclients_wait:"\
  " #{@sdkclients_wait.inspect}, site_id: #{@site_id.inspect}, unconnected_clients_wait:"\
  " #{@unconnected_clients_wait.inspect}, vertices: #{@vertices.inspect}, vertices_m:"\
  " #{@vertices_m.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



256
257
258
259
260
261
262
263
264
265
266
# File 'lib/mist_api/models/stats_zone.rb', line 256

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} assets_wait: #{@assets_wait}, clients_wait: #{@clients_wait}, created_time:"\
  " #{@created_time}, discovered_assets_wait: #{@discovered_assets_wait}, id: #{@id}, map_id:"\
  " #{@map_id}, modified_time: #{@modified_time}, name: #{@name}, num_assets: #{@num_assets},"\
  " num_clients: #{@num_clients}, num_discovered_assets: #{@num_discovered_assets},"\
  " num_sdkclients: #{@num_sdkclients}, num_unconnected_clients: #{@num_unconnected_clients},"\
  " occupancy_limit: #{@occupancy_limit}, org_id: #{@org_id}, sdkclients_wait:"\
  " #{@sdkclients_wait}, site_id: #{@site_id}, unconnected_clients_wait:"\
  " #{@unconnected_clients_wait}, vertices: #{@vertices}, vertices_m: #{@vertices_m}>"
end