Class: MistApi::Vbeacon

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

Overview

vBeacon

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(created_time = SKIP, for_site = SKIP, id = SKIP, major = SKIP, map_id = SKIP, message = SKIP, minor = SKIP, modified_time = SKIP, name = SKIP, org_id = SKIP, power = 4, power_mode = BleConfigPowerModeEnum::DEFAULT, site_id = SKIP, url = SKIP, uuid = SKIP, wayfinding_nodename = SKIP, x = SKIP, y = SKIP, additional_properties = nil) ⇒ Vbeacon

Returns a new instance of Vbeacon.



138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# File 'lib/mist_api/models/vbeacon.rb', line 138

def initialize(created_time = SKIP, for_site = SKIP, id = SKIP,
               major = SKIP, map_id = SKIP, message = SKIP, minor = SKIP,
               modified_time = SKIP, name = SKIP, org_id = SKIP, power = 4,
               power_mode = BleConfigPowerModeEnum::DEFAULT, site_id = SKIP,
               url = SKIP, uuid = SKIP, wayfinding_nodename = SKIP,
               x = SKIP, y = SKIP, additional_properties = nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @created_time = created_time unless created_time == SKIP
  @for_site = for_site unless for_site == SKIP
  @id = id unless id == SKIP
  @major = major unless major == SKIP
  @map_id = map_id unless map_id == SKIP
  @message = message unless message == SKIP
  @minor = minor unless minor == SKIP
  @modified_time = modified_time unless modified_time == SKIP
  @name = name unless name == SKIP
  @org_id = org_id unless org_id == SKIP
  @power = power unless power == SKIP
  @power_mode = power_mode unless power_mode == SKIP
  @site_id = site_id unless site_id == SKIP
  @url = url unless url == SKIP
  @uuid = uuid unless uuid == SKIP
  @wayfinding_nodename = wayfinding_nodename unless wayfinding_nodename == SKIP
  @x = x unless x == SKIP
  @y = y unless y == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#created_timeFloat

When the object has been created, in epoch

Returns:

  • (Float)


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

def created_time
  @created_time
end

#for_siteTrueClass | FalseClass

When the object has been created, in epoch

Returns:

  • (TrueClass | FalseClass)


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

def for_site
  @for_site
end

#idUUID | String

Unique ID of the object instance in the Mist Organization

Returns:

  • (UUID | String)


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

def id
  @id
end

#majorInteger

Bluetooth tag major

Returns:

  • (Integer)


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

def major
  @major
end

#map_idUUID | String

Map where the device belongs to

Returns:

  • (UUID | String)


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

def map_id
  @map_id
end

#messageString

Message that can be displayed when the sdkclient gets near the vbeacon

Returns:

  • (String)


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

def message
  @message
end

#minorInteger

Bluetooth tag minor

Returns:

  • (Integer)


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

def minor
  @minor
end

#modified_timeFloat

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

Returns:

  • (Float)


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

def modified_time
  @modified_time
end

#nameString

Name / label of the device

Returns:

  • (String)


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

def name
  @name
end

#org_idUUID | String

Name / label of the device

Returns:

  • (UUID | String)


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

def org_id
  @org_id
end

#powerInteger

Required if ‘power_mode`==`custom`, -30 - 100, in dBm. For default power_mode, power = 4 dBm.

Returns:

  • (Integer)


55
56
57
# File 'lib/mist_api/models/vbeacon.rb', line 55

def power
  @power
end

#power_modeBleConfigPowerModeEnum

enum: ‘custom`, `default`



59
60
61
# File 'lib/mist_api/models/vbeacon.rb', line 59

def power_mode
  @power_mode
end

#site_idUUID | String

enum: ‘custom`, `default`

Returns:

  • (UUID | String)


63
64
65
# File 'lib/mist_api/models/vbeacon.rb', line 63

def site_id
  @site_id
end

#urlString

URL to show, optional

Returns:

  • (String)


67
68
69
# File 'lib/mist_api/models/vbeacon.rb', line 67

def url
  @url
end

#uuidUUID | String

Bluetooth tag UUID

Returns:

  • (UUID | String)


71
72
73
# File 'lib/mist_api/models/vbeacon.rb', line 71

def uuid
  @uuid
end

#wayfinding_nodenameString

Name to be used in wayfinding_path or wayfinding_grid blob

Returns:

  • (String)


75
76
77
# File 'lib/mist_api/models/vbeacon.rb', line 75

def wayfinding_nodename
  @wayfinding_nodename
end

#xFloat

X in pixel

Returns:

  • (Float)


79
80
81
# File 'lib/mist_api/models/vbeacon.rb', line 79

def x
  @x
end

#yFloat

Y in pixel

Returns:

  • (Float)


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

def y
  @y
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



169
170
171
172
173
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
220
# File 'lib/mist_api/models/vbeacon.rb', line 169

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  created_time = hash.key?('created_time') ? hash['created_time'] : SKIP
  for_site = hash.key?('for_site') ? hash['for_site'] : SKIP
  id = hash.key?('id') ? hash['id'] : SKIP
  major = hash.key?('major') ? hash['major'] : SKIP
  map_id = hash.key?('map_id') ? hash['map_id'] : SKIP
  message = hash.key?('message') ? hash['message'] : SKIP
  minor = hash.key?('minor') ? hash['minor'] : SKIP
  modified_time = hash.key?('modified_time') ? hash['modified_time'] : SKIP
  name = hash.key?('name') ? hash['name'] : SKIP
  org_id = hash.key?('org_id') ? hash['org_id'] : SKIP
  power = hash['power'] ||= 4
  power_mode = hash['power_mode'] ||= BleConfigPowerModeEnum::DEFAULT
  site_id = hash.key?('site_id') ? hash['site_id'] : SKIP
  url = hash.key?('url') ? hash['url'] : SKIP
  uuid = hash.key?('uuid') ? hash['uuid'] : SKIP
  wayfinding_nodename =
    hash.key?('wayfinding_nodename') ? hash['wayfinding_nodename'] : SKIP
  x = hash.key?('x') ? hash['x'] : SKIP
  y = hash.key?('y') ? hash['y'] : SKIP

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  Vbeacon.new(created_time,
              for_site,
              id,
              major,
              map_id,
              message,
              minor,
              modified_time,
              name,
              org_id,
              power,
              power_mode,
              site_id,
              url,
              uuid,
              wayfinding_nodename,
              x,
              y,
              additional_properties)
end

.namesObject

A mapping from model property names to API property names.



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/mist_api/models/vbeacon.rb', line 86

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['created_time'] = 'created_time'
  @_hash['for_site'] = 'for_site'
  @_hash['id'] = 'id'
  @_hash['major'] = 'major'
  @_hash['map_id'] = 'map_id'
  @_hash['message'] = 'message'
  @_hash['minor'] = 'minor'
  @_hash['modified_time'] = 'modified_time'
  @_hash['name'] = 'name'
  @_hash['org_id'] = 'org_id'
  @_hash['power'] = 'power'
  @_hash['power_mode'] = 'power_mode'
  @_hash['site_id'] = 'site_id'
  @_hash['url'] = 'url'
  @_hash['uuid'] = 'uuid'
  @_hash['wayfinding_nodename'] = 'wayfinding_nodename'
  @_hash['x'] = 'x'
  @_hash['y'] = 'y'
  @_hash
end

.nullablesObject

An array for nullable fields



134
135
136
# File 'lib/mist_api/models/vbeacon.rb', line 134

def self.nullables
  []
end

.optionalsObject

An array for optional fields



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/mist_api/models/vbeacon.rb', line 110

def self.optionals
  %w[
    created_time
    for_site
    id
    major
    map_id
    message
    minor
    modified_time
    name
    org_id
    power
    power_mode
    site_id
    url
    uuid
    wayfinding_nodename
    x
    y
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



234
235
236
237
238
239
240
241
242
243
# File 'lib/mist_api/models/vbeacon.rb', line 234

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} created_time: #{@created_time.inspect}, for_site: #{@for_site.inspect}, id:"\
  " #{@id.inspect}, major: #{@major.inspect}, map_id: #{@map_id.inspect}, message:"\
  " #{@message.inspect}, minor: #{@minor.inspect}, modified_time: #{@modified_time.inspect},"\
  " name: #{@name.inspect}, org_id: #{@org_id.inspect}, power: #{@power.inspect}, power_mode:"\
  " #{@power_mode.inspect}, site_id: #{@site_id.inspect}, url: #{@url.inspect}, uuid:"\
  " #{@uuid.inspect}, wayfinding_nodename: #{@wayfinding_nodename.inspect}, x: #{@x.inspect},"\
  " y: #{@y.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



223
224
225
226
227
228
229
230
231
# File 'lib/mist_api/models/vbeacon.rb', line 223

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} created_time: #{@created_time}, for_site: #{@for_site}, id: #{@id}, major:"\
  " #{@major}, map_id: #{@map_id}, message: #{@message}, minor: #{@minor}, modified_time:"\
  " #{@modified_time}, name: #{@name}, org_id: #{@org_id}, power: #{@power}, power_mode:"\
  " #{@power_mode}, site_id: #{@site_id}, url: #{@url}, uuid: #{@uuid}, wayfinding_nodename:"\
  " #{@wayfinding_nodename}, x: #{@x}, y: #{@y}, additional_properties:"\
  " #{@additional_properties}>"
end