Class: MistApi::InstallerDevice

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

Overview

InstallerDevice 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(ble_stat = SKIP, connected = SKIP, deviceprofile_name = SKIP, ext_ip = SKIP, height = SKIP, ip = SKIP, last_seen = SKIP, mac = SKIP, map_id = SKIP, model = SKIP, name = SKIP, orientation = SKIP, serial = SKIP, site_name = SKIP, uptime = SKIP, vc_mac = SKIP, version = SKIP, x = SKIP, y = SKIP) ⇒ InstallerDevice

Returns a new instance of InstallerDevice.



146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# File 'lib/mist_api/models/installer_device.rb', line 146

def initialize(ble_stat = SKIP, connected = SKIP, deviceprofile_name = SKIP,
               ext_ip = SKIP, height = SKIP, ip = SKIP, last_seen = SKIP,
               mac = SKIP, map_id = SKIP, model = SKIP, name = SKIP,
               orientation = SKIP, serial = SKIP, site_name = SKIP,
               uptime = SKIP, vc_mac = SKIP, version = SKIP, x = SKIP,
               y = SKIP)
  @ble_stat = ble_stat unless ble_stat == SKIP
  @connected = connected unless connected == SKIP
  @deviceprofile_name = deviceprofile_name unless deviceprofile_name == SKIP
  @ext_ip = ext_ip unless ext_ip == SKIP
  @height = height unless height == SKIP
  @ip = ip unless ip == SKIP
  @last_seen = last_seen unless last_seen == SKIP
  @mac = mac unless mac == SKIP
  @map_id = map_id unless map_id == SKIP
  @model = model unless model == SKIP
  @name = name unless name == SKIP
  @orientation = orientation unless orientation == SKIP
  @serial = serial unless serial == SKIP
  @site_name = site_name unless site_name == SKIP
  @uptime = uptime unless uptime == SKIP
  @vc_mac = vc_mac unless vc_mac == SKIP
  @version = version unless version == SKIP
  @x = x unless x == SKIP
  @y = y unless y == SKIP
end

Instance Attribute Details

#ble_statInstallerDeviceBleStat

BLE statistics for the device



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

def ble_stat
  @ble_stat
end

#connectedTrueClass | FalseClass

BLE statistics for the device

Returns:

  • (TrueClass | FalseClass)


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

def connected
  @connected
end

#deviceprofile_nameString

BLE statistics for the device

Returns:

  • (String)


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

def deviceprofile_name
  @deviceprofile_name
end

#ext_ipString

BLE statistics for the device

Returns:

  • (String)


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

def ext_ip
  @ext_ip
end

#heightFloat

BLE statistics for the device

Returns:

  • (Float)


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

def height
  @height
end

#ipString

BLE statistics for the device

Returns:

  • (String)


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

def ip
  @ip
end

#last_seenFloat

Last seen timestamp

Returns:

  • (Float)


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

def last_seen
  @last_seen
end

#macString

Last seen timestamp

Returns:

  • (String)


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

def mac
  @mac
end

#map_idUUID | String

Last seen timestamp

Returns:

  • (UUID | String)


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

def map_id
  @map_id
end

#modelString

Last seen timestamp

Returns:

  • (String)


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

def model
  @model
end

#nameString

Last seen timestamp

Returns:

  • (String)


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

def name
  @name
end

#orientationInteger

Last seen timestamp

Returns:

  • (Integer)


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

def orientation
  @orientation
end

#serialString

Last seen timestamp

Returns:

  • (String)


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

def serial
  @serial
end

#site_nameString

Last seen timestamp

Returns:

  • (String)


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

def site_name
  @site_name
end

#uptimeInteger

Last seen timestamp

Returns:

  • (Integer)


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

def uptime
  @uptime
end

#vc_macString

Last seen timestamp

Returns:

  • (String)


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

def vc_mac
  @vc_mac
end

#versionString

Last seen timestamp

Returns:

  • (String)


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

def version
  @version
end

#xFloat

Last seen timestamp

Returns:

  • (Float)


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

def x
  @x
end

#yFloat

Last seen timestamp

Returns:

  • (Float)


86
87
88
# File 'lib/mist_api/models/installer_device.rb', line 86

def y
  @y
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



174
175
176
177
178
179
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
# File 'lib/mist_api/models/installer_device.rb', line 174

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  ble_stat = InstallerDeviceBleStat.from_hash(hash['ble_stat']) if hash['ble_stat']
  connected = hash.key?('connected') ? hash['connected'] : SKIP
  deviceprofile_name =
    hash.key?('deviceprofile_name') ? hash['deviceprofile_name'] : SKIP
  ext_ip = hash.key?('ext_ip') ? hash['ext_ip'] : SKIP
  height = hash.key?('height') ? hash['height'] : SKIP
  ip = hash.key?('ip') ? hash['ip'] : SKIP
  last_seen = hash.key?('last_seen') ? hash['last_seen'] : SKIP
  mac = hash.key?('mac') ? hash['mac'] : SKIP
  map_id = hash.key?('map_id') ? hash['map_id'] : SKIP
  model = hash.key?('model') ? hash['model'] : SKIP
  name = hash.key?('name') ? hash['name'] : SKIP
  orientation = hash.key?('orientation') ? hash['orientation'] : SKIP
  serial = hash.key?('serial') ? hash['serial'] : SKIP
  site_name = hash.key?('site_name') ? hash['site_name'] : SKIP
  uptime = hash.key?('uptime') ? hash['uptime'] : SKIP
  vc_mac = hash.key?('vc_mac') ? hash['vc_mac'] : SKIP
  version = hash.key?('version') ? hash['version'] : SKIP
  x = hash.key?('x') ? hash['x'] : SKIP
  y = hash.key?('y') ? hash['y'] : SKIP

  # Create object from extracted values.
  InstallerDevice.new(ble_stat,
                      connected,
                      deviceprofile_name,
                      ext_ip,
                      height,
                      ip,
                      last_seen,
                      mac,
                      map_id,
                      model,
                      name,
                      orientation,
                      serial,
                      site_name,
                      uptime,
                      vc_mac,
                      version,
                      x,
                      y)
end

.namesObject

A mapping from model property names to API property names.



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/mist_api/models/installer_device.rb', line 89

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['ble_stat'] = 'ble_stat'
  @_hash['connected'] = 'connected'
  @_hash['deviceprofile_name'] = 'deviceprofile_name'
  @_hash['ext_ip'] = 'ext_ip'
  @_hash['height'] = 'height'
  @_hash['ip'] = 'ip'
  @_hash['last_seen'] = 'last_seen'
  @_hash['mac'] = 'mac'
  @_hash['map_id'] = 'map_id'
  @_hash['model'] = 'model'
  @_hash['name'] = 'name'
  @_hash['orientation'] = 'orientation'
  @_hash['serial'] = 'serial'
  @_hash['site_name'] = 'site_name'
  @_hash['uptime'] = 'uptime'
  @_hash['vc_mac'] = 'vc_mac'
  @_hash['version'] = 'version'
  @_hash['x'] = 'x'
  @_hash['y'] = 'y'
  @_hash
end

.nullablesObject

An array for nullable fields



139
140
141
142
143
144
# File 'lib/mist_api/models/installer_device.rb', line 139

def self.nullables
  %w[
    last_seen
    vc_mac
  ]
end

.optionalsObject

An array for optional fields



114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/mist_api/models/installer_device.rb', line 114

def self.optionals
  %w[
    ble_stat
    connected
    deviceprofile_name
    ext_ip
    height
    ip
    last_seen
    mac
    map_id
    model
    name
    orientation
    serial
    site_name
    uptime
    vc_mac
    version
    x
    y
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



232
233
234
235
236
237
238
239
240
241
# File 'lib/mist_api/models/installer_device.rb', line 232

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} ble_stat: #{@ble_stat.inspect}, connected: #{@connected.inspect},"\
  " deviceprofile_name: #{@deviceprofile_name.inspect}, ext_ip: #{@ext_ip.inspect}, height:"\
  " #{@height.inspect}, ip: #{@ip.inspect}, last_seen: #{@last_seen.inspect}, mac:"\
  " #{@mac.inspect}, map_id: #{@map_id.inspect}, model: #{@model.inspect}, name:"\
  " #{@name.inspect}, orientation: #{@orientation.inspect}, serial: #{@serial.inspect},"\
  " site_name: #{@site_name.inspect}, uptime: #{@uptime.inspect}, vc_mac: #{@vc_mac.inspect},"\
  " version: #{@version.inspect}, x: #{@x.inspect}, y: #{@y.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



222
223
224
225
226
227
228
229
# File 'lib/mist_api/models/installer_device.rb', line 222

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} ble_stat: #{@ble_stat}, connected: #{@connected}, deviceprofile_name:"\
  " #{@deviceprofile_name}, ext_ip: #{@ext_ip}, height: #{@height}, ip: #{@ip}, last_seen:"\
  " #{@last_seen}, mac: #{@mac}, map_id: #{@map_id}, model: #{@model}, name: #{@name},"\
  " orientation: #{@orientation}, serial: #{@serial}, site_name: #{@site_name}, uptime:"\
  " #{@uptime}, vc_mac: #{@vc_mac}, version: #{@version}, x: #{@x}, y: #{@y}>"
end