Class: MistApi::SdkstatsWirelessClient

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

Overview

SDK Client Details 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, uuid = nil, last_seen = SKIP, map_id = SKIP, name = SKIP, network_connection = SKIP, vbeacons = SKIP, x = SKIP, y = SKIP, zones = SKIP) ⇒ SdkstatsWirelessClient

Returns a new instance of SdkstatsWirelessClient.



91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/mist_api/models/sdkstats_wireless_client.rb', line 91

def initialize(id = nil, uuid = nil, last_seen = SKIP, map_id = SKIP,
               name = SKIP, network_connection = SKIP, vbeacons = SKIP,
               x = SKIP, y = SKIP, zones = SKIP)
  @id = id
  @last_seen = last_seen unless last_seen == SKIP
  @map_id = map_id unless map_id == SKIP
  @name = name unless name == SKIP
  @network_connection = network_connection unless network_connection == SKIP
  @uuid = uuid
  @vbeacons = vbeacons unless vbeacons == SKIP
  @x = x unless x == SKIP
  @y = y unless y == SKIP
  @zones = zones unless zones == SKIP
end

Instance Attribute Details

#idUUID | String

Unique ID of the object instance in the Mist Organization

Returns:

  • (UUID | String)


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

def id
  @id
end

#last_seenFloat

Last seen timestamp

Returns:

  • (Float)


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

def last_seen
  @last_seen
end

#map_idUUID | String

Map_id of the sdk client (if known), or null

Returns:

  • (UUID | String)


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

def map_id
  @map_id
end

#nameString

Name of the sdk client (if provided)

Returns:

  • (String)


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

def name
  @name
end

#network_connectionStatsSdkclientNetworkConnection

Various network connection info for the SDK client (if known, else omitted), with RSSI in dBm, and signal level as



31
32
33
# File 'lib/mist_api/models/sdkstats_wireless_client.rb', line 31

def network_connection
  @network_connection
end

#uuidUUID | String

UUID of the sdk client

Returns:

  • (UUID | String)


35
36
37
# File 'lib/mist_api/models/sdkstats_wireless_client.rb', line 35

def uuid
  @uuid
end

#vbeaconsArray[SdkstatsWirelessClientVbeacon]

List of beacon_id’s of the sdk client is in and since when (if known)

Returns:



39
40
41
# File 'lib/mist_api/models/sdkstats_wireless_client.rb', line 39

def vbeacons
  @vbeacons
end

#xFloat

X (in pixels) of user location on the map (if known)

Returns:

  • (Float)


43
44
45
# File 'lib/mist_api/models/sdkstats_wireless_client.rb', line 43

def x
  @x
end

#yFloat

Y (in pixels) of user location on the map (if known)

Returns:

  • (Float)


47
48
49
# File 'lib/mist_api/models/sdkstats_wireless_client.rb', line 47

def y
  @y
end

#zonesArray[SdkstatsWirelessClientZone]

List of zone_id’s of the sdk client is in and since when (if known)

Returns:



51
52
53
# File 'lib/mist_api/models/sdkstats_wireless_client.rb', line 51

def zones
  @zones
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
146
147
148
149
150
151
152
# File 'lib/mist_api/models/sdkstats_wireless_client.rb', line 107

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  id = hash.key?('id') ? hash['id'] : nil
  uuid = hash.key?('uuid') ? hash['uuid'] : nil
  last_seen = hash.key?('last_seen') ? hash['last_seen'] : SKIP
  map_id = hash.key?('map_id') ? hash['map_id'] : SKIP
  name = hash.key?('name') ? hash['name'] : SKIP
  network_connection = StatsSdkclientNetworkConnection.from_hash(hash['network_connection']) if
    hash['network_connection']
  # Parameter is an array, so we need to iterate through it
  vbeacons = nil
  unless hash['vbeacons'].nil?
    vbeacons = []
    hash['vbeacons'].each do |structure|
      vbeacons << (SdkstatsWirelessClientVbeacon.from_hash(structure) if structure)
    end
  end

  vbeacons = SKIP unless hash.key?('vbeacons')
  x = hash.key?('x') ? hash['x'] : SKIP
  y = hash.key?('y') ? hash['y'] : SKIP
  # Parameter is an array, so we need to iterate through it
  zones = nil
  unless hash['zones'].nil?
    zones = []
    hash['zones'].each do |structure|
      zones << (SdkstatsWirelessClientZone.from_hash(structure) if structure)
    end
  end

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

  # Create object from extracted values.
  SdkstatsWirelessClient.new(id,
                             uuid,
                             last_seen,
                             map_id,
                             name,
                             network_connection,
                             vbeacons,
                             x,
                             y,
                             zones)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['id'] = 'id'
  @_hash['last_seen'] = 'last_seen'
  @_hash['map_id'] = 'map_id'
  @_hash['name'] = 'name'
  @_hash['network_connection'] = 'network_connection'
  @_hash['uuid'] = 'uuid'
  @_hash['vbeacons'] = 'vbeacons'
  @_hash['x'] = 'x'
  @_hash['y'] = 'y'
  @_hash['zones'] = 'zones'
  @_hash
end

.nullablesObject

An array for nullable fields



84
85
86
87
88
89
# File 'lib/mist_api/models/sdkstats_wireless_client.rb', line 84

def self.nullables
  %w[
    last_seen
    map_id
  ]
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    last_seen
    map_id
    name
    network_connection
    vbeacons
    x
    y
    zones
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



163
164
165
166
167
168
169
# File 'lib/mist_api/models/sdkstats_wireless_client.rb', line 163

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id.inspect}, last_seen: #{@last_seen.inspect}, map_id:"\
  " #{@map_id.inspect}, name: #{@name.inspect}, network_connection:"\
  " #{@network_connection.inspect}, uuid: #{@uuid.inspect}, vbeacons: #{@vbeacons.inspect}, x:"\
  " #{@x.inspect}, y: #{@y.inspect}, zones: #{@zones.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



155
156
157
158
159
160
# File 'lib/mist_api/models/sdkstats_wireless_client.rb', line 155

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id}, last_seen: #{@last_seen}, map_id: #{@map_id}, name: #{@name},"\
  " network_connection: #{@network_connection}, uuid: #{@uuid}, vbeacons: #{@vbeacons}, x:"\
  " #{@x}, y: #{@y}, zones: #{@zones}>"
end