Class: MistApi::AssetFilter

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

Overview

Asset Filter

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(name = nil, ap_mac = SKIP, beam = SKIP, created_time = SKIP, disabled = false, eddystone_uid_namespace = SKIP, eddystone_url = SKIP, for_site = SKIP, ibeacon_major = SKIP, ibeacon_uuid = SKIP, id = SKIP, mfg_company_id = SKIP, modified_time = SKIP, org_id = SKIP, rssi = SKIP, service_uuid = SKIP, site_id = SKIP, additional_properties = nil) ⇒ AssetFilter

Returns a new instance of AssetFilter.



133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# File 'lib/mist_api/models/asset_filter.rb', line 133

def initialize(name = nil, ap_mac = SKIP, beam = SKIP, created_time = SKIP,
               disabled = false, eddystone_uid_namespace = SKIP,
               eddystone_url = SKIP, for_site = SKIP, ibeacon_major = SKIP,
               ibeacon_uuid = SKIP, id = SKIP, mfg_company_id = SKIP,
               modified_time = SKIP, org_id = SKIP, rssi = SKIP,
               service_uuid = SKIP, site_id = SKIP,
               additional_properties = nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @ap_mac = ap_mac unless ap_mac == SKIP
  @beam = beam unless beam == SKIP
  @created_time = created_time unless created_time == SKIP
  @disabled = disabled unless disabled == SKIP
  @eddystone_uid_namespace = eddystone_uid_namespace unless eddystone_uid_namespace == SKIP
  @eddystone_url = eddystone_url unless eddystone_url == SKIP
  @for_site = for_site unless for_site == SKIP
  @ibeacon_major = ibeacon_major unless ibeacon_major == SKIP
  @ibeacon_uuid = ibeacon_uuid unless ibeacon_uuid == SKIP
  @id = id unless id == SKIP
  @mfg_company_id = mfg_company_id unless mfg_company_id == SKIP
  @modified_time = modified_time unless modified_time == SKIP
  @name = name
  @org_id = org_id unless org_id == SKIP
  @rssi = rssi unless rssi == SKIP
  @service_uuid = service_uuid unless service_uuid == SKIP
  @site_id = site_id unless site_id == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#ap_macString

TODO: Write general description for this method

Returns:

  • (String)


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

def ap_mac
  @ap_mac
end

#beamInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def beam
  @beam
end

#created_timeFloat

When the object has been created, in epoch

Returns:

  • (Float)


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

def created_time
  @created_time
end

#disabledTrueClass | FalseClass

Whether the asset filter is disabled

Returns:

  • (TrueClass | FalseClass)


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

def disabled
  @disabled
end

#eddystone_uid_namespaceString

Eddystone uid namespace used to filter assets

Returns:

  • (String)


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

def eddystone_uid_namespace
  @eddystone_uid_namespace
end

#eddystone_urlString

Eddystone url used to filter assets

Returns:

  • (String)


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

def eddystone_url
  @eddystone_url
end

#for_siteTrueClass | FalseClass

Eddystone url used to filter assets

Returns:

  • (TrueClass | FalseClass)


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

def for_site
  @for_site
end

#ibeacon_majorInteger

Major number for iBeacon

Returns:

  • (Integer)


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

def ibeacon_major
  @ibeacon_major
end

#ibeacon_uuidUUID | String

Major number for iBeacon

Returns:

  • (UUID | String)


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

def ibeacon_uuid
  @ibeacon_uuid
end

#idUUID | String

Unique ID of the object instance in the Mist Organization

Returns:

  • (UUID | String)


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

def id
  @id
end

#mfg_company_idInteger

BLE manufacturing-specific company-id used to filter assets

Returns:

  • (Integer)


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

def mfg_company_id
  @mfg_company_id
end

#modified_timeFloat

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

Returns:

  • (Float)


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

def modified_time
  @modified_time
end

#nameString

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

Returns:

  • (String)


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

def name
  @name
end

#org_idUUID | String

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

Returns:

  • (UUID | String)


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

def org_id
  @org_id
end

#rssiInteger

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

Returns:

  • (Integer)


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

def rssi
  @rssi
end

#service_uuidUUID | String

BLE service data uuid used to filter assets

Returns:

  • (UUID | String)


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

def service_uuid
  @service_uuid
end

#site_idUUID | String

BLE service data uuid used to filter assets

Returns:

  • (UUID | String)


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

def site_id
  @site_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



164
165
166
167
168
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
# File 'lib/mist_api/models/asset_filter.rb', line 164

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  name = hash.key?('name') ? hash['name'] : nil
  ap_mac = hash.key?('ap_mac') ? hash['ap_mac'] : SKIP
  beam = hash.key?('beam') ? hash['beam'] : SKIP
  created_time = hash.key?('created_time') ? hash['created_time'] : SKIP
  disabled = hash['disabled'] ||= false
  eddystone_uid_namespace =
    hash.key?('eddystone_uid_namespace') ? hash['eddystone_uid_namespace'] : SKIP
  eddystone_url = hash.key?('eddystone_url') ? hash['eddystone_url'] : SKIP
  for_site = hash.key?('for_site') ? hash['for_site'] : SKIP
  ibeacon_major = hash.key?('ibeacon_major') ? hash['ibeacon_major'] : SKIP
  ibeacon_uuid = hash.key?('ibeacon_uuid') ? hash['ibeacon_uuid'] : SKIP
  id = hash.key?('id') ? hash['id'] : SKIP
  mfg_company_id =
    hash.key?('mfg_company_id') ? hash['mfg_company_id'] : SKIP
  modified_time = hash.key?('modified_time') ? hash['modified_time'] : SKIP
  org_id = hash.key?('org_id') ? hash['org_id'] : SKIP
  rssi = hash.key?('rssi') ? hash['rssi'] : SKIP
  service_uuid = hash.key?('service_uuid') ? hash['service_uuid'] : SKIP
  site_id = hash.key?('site_id') ? hash['site_id'] : 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.
  AssetFilter.new(name,
                  ap_mac,
                  beam,
                  created_time,
                  disabled,
                  eddystone_uid_namespace,
                  eddystone_url,
                  for_site,
                  ibeacon_major,
                  ibeacon_uuid,
                  id,
                  mfg_company_id,
                  modified_time,
                  org_id,
                  rssi,
                  service_uuid,
                  site_id,
                  additional_properties)
end

.namesObject

A mapping from model property names to API property names.



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/mist_api/models/asset_filter.rb', line 81

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['ap_mac'] = 'ap_mac'
  @_hash['beam'] = 'beam'
  @_hash['created_time'] = 'created_time'
  @_hash['disabled'] = 'disabled'
  @_hash['eddystone_uid_namespace'] = 'eddystone_uid_namespace'
  @_hash['eddystone_url'] = 'eddystone_url'
  @_hash['for_site'] = 'for_site'
  @_hash['ibeacon_major'] = 'ibeacon_major'
  @_hash['ibeacon_uuid'] = 'ibeacon_uuid'
  @_hash['id'] = 'id'
  @_hash['mfg_company_id'] = 'mfg_company_id'
  @_hash['modified_time'] = 'modified_time'
  @_hash['name'] = 'name'
  @_hash['org_id'] = 'org_id'
  @_hash['rssi'] = 'rssi'
  @_hash['service_uuid'] = 'service_uuid'
  @_hash['site_id'] = 'site_id'
  @_hash
end

.nullablesObject

An array for nullable fields



126
127
128
129
130
131
# File 'lib/mist_api/models/asset_filter.rb', line 126

def self.nullables
  %w[
    ibeacon_major
    ibeacon_uuid
  ]
end

.optionalsObject

An array for optional fields



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/mist_api/models/asset_filter.rb', line 104

def self.optionals
  %w[
    ap_mac
    beam
    created_time
    disabled
    eddystone_uid_namespace
    eddystone_url
    for_site
    ibeacon_major
    ibeacon_uuid
    id
    mfg_company_id
    modified_time
    org_id
    rssi
    service_uuid
    site_id
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



229
230
231
232
233
234
235
236
237
238
239
# File 'lib/mist_api/models/asset_filter.rb', line 229

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} ap_mac: #{@ap_mac.inspect}, beam: #{@beam.inspect}, created_time:"\
  " #{@created_time.inspect}, disabled: #{@disabled.inspect}, eddystone_uid_namespace:"\
  " #{@eddystone_uid_namespace.inspect}, eddystone_url: #{@eddystone_url.inspect}, for_site:"\
  " #{@for_site.inspect}, ibeacon_major: #{@ibeacon_major.inspect}, ibeacon_uuid:"\
  " #{@ibeacon_uuid.inspect}, id: #{@id.inspect}, mfg_company_id: #{@mfg_company_id.inspect},"\
  " modified_time: #{@modified_time.inspect}, name: #{@name.inspect}, org_id:"\
  " #{@org_id.inspect}, rssi: #{@rssi.inspect}, service_uuid: #{@service_uuid.inspect},"\
  " site_id: #{@site_id.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



217
218
219
220
221
222
223
224
225
226
# File 'lib/mist_api/models/asset_filter.rb', line 217

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} ap_mac: #{@ap_mac}, beam: #{@beam}, created_time: #{@created_time},"\
  " disabled: #{@disabled}, eddystone_uid_namespace: #{@eddystone_uid_namespace},"\
  " eddystone_url: #{@eddystone_url}, for_site: #{@for_site}, ibeacon_major:"\
  " #{@ibeacon_major}, ibeacon_uuid: #{@ibeacon_uuid}, id: #{@id}, mfg_company_id:"\
  " #{@mfg_company_id}, modified_time: #{@modified_time}, name: #{@name}, org_id: #{@org_id},"\
  " rssi: #{@rssi}, service_uuid: #{@service_uuid}, site_id: #{@site_id},"\
  " additional_properties: #{@additional_properties}>"
end