Class: Verizon::ResourceDevice

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/verizon/models/resource_device.rb

Overview

ResourceDevice 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(createdon:, foreignid:, lastupdated:, state:, versionid:, accountclientid: SKIP, billingaccountid: SKIP, chipset: SKIP, customdata: SKIP, description: SKIP, esn: SKIP, fields: SKIP, hardwareversion: SKIP, iccid: SKIP, id: SKIP, imei: SKIP, imsi: SKIP, licenses: SKIP, mac: SKIP, manufacturer: SKIP, meid: SKIP, msisdn: SKIP, name: SKIP, parentdeviceid: SKIP, productmodel: SKIP, providerid: SKIP, qrcode: SKIP, refid: SKIP, refidtype: SKIP, serial: SKIP, services: SKIP, sku: SKIP, softwareversion: SKIP, version: SKIP, eventretention: SKIP) ⇒ ResourceDevice

Returns a new instance of ResourceDevice.



240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
# File 'lib/verizon/models/resource_device.rb', line 240

def initialize(createdon:, foreignid:, lastupdated:, state:, versionid:,
               accountclientid: SKIP, billingaccountid: SKIP, chipset: SKIP,
               customdata: SKIP, description: SKIP, esn: SKIP, fields: SKIP,
               hardwareversion: SKIP, iccid: SKIP, id: SKIP, imei: SKIP,
               imsi: SKIP, licenses: SKIP, mac: SKIP, manufacturer: SKIP,
               meid: SKIP, msisdn: SKIP, name: SKIP, parentdeviceid: SKIP,
               productmodel: SKIP, providerid: SKIP, qrcode: SKIP,
               refid: SKIP, refidtype: SKIP, serial: SKIP, services: SKIP,
               sku: SKIP, softwareversion: SKIP, version: SKIP,
               eventretention: SKIP)
  @accountclientid = accountclientid unless accountclientid == SKIP
  @billingaccountid = billingaccountid unless billingaccountid == SKIP
  @chipset = chipset unless chipset == SKIP
  @createdon = createdon
  @customdata = customdata unless customdata == SKIP
  @description = description unless description == SKIP
  @esn = esn unless esn == SKIP
  @fields = fields unless fields == SKIP
  @foreignid = foreignid
  @hardwareversion = hardwareversion unless hardwareversion == SKIP
  @iccid = iccid unless iccid == SKIP
  @id = id unless id == SKIP
  @imei = imei unless imei == SKIP
  @imsi = imsi unless imsi == SKIP
  @lastupdated = lastupdated
  @licenses = licenses unless licenses == SKIP
  @mac = mac unless mac == SKIP
  @manufacturer = manufacturer unless manufacturer == SKIP
  @meid = meid unless meid == SKIP
  @msisdn = msisdn unless msisdn == SKIP
  @name = name unless name == SKIP
  @parentdeviceid = parentdeviceid unless parentdeviceid == SKIP
  @productmodel = productmodel unless productmodel == SKIP
  @providerid = providerid unless providerid == SKIP
  @qrcode = qrcode unless qrcode == SKIP
  @refid = refid unless refid == SKIP
  @refidtype = refidtype unless refidtype == SKIP
  @serial = serial unless serial == SKIP
  @services = services unless services == SKIP
  @sku = sku unless sku == SKIP
  @softwareversion = softwareversion unless softwareversion == SKIP
  @state = state
  @version = version unless version == SKIP
  @versionid = versionid
  @eventretention = eventretention unless eventretention == SKIP
end

Instance Attribute Details

#accountclientidString

Not used in this release, future functionality

Returns:

  • (String)


15
16
17
# File 'lib/verizon/models/resource_device.rb', line 15

def accountclientid
  @accountclientid
end

#billingaccountidString

The billing account ID. This is the same value as the Account ID

Returns:

  • (String)


19
20
21
# File 'lib/verizon/models/resource_device.rb', line 19

def billingaccountid
  @billingaccountid
end

#chipsetString

The Identifier of chipset used by the device

Returns:

  • (String)


23
24
25
# File 'lib/verizon/models/resource_device.rb', line 23

def chipset
  @chipset
end

#createdonDateTime

Timestamp of the record

Returns:

  • (DateTime)


27
28
29
# File 'lib/verizon/models/resource_device.rb', line 27

def createdon
  @createdon
end

#customdataHash[String, Object]

Name/value pair, where the value is client defined. The purpose is to keep track of current state per device action.

Returns:

  • (Hash[String, Object])


32
33
34
# File 'lib/verizon/models/resource_device.rb', line 32

def customdata
  @customdata
end

#descriptionString

a short description

Returns:

  • (String)


36
37
38
# File 'lib/verizon/models/resource_device.rb', line 36

def description
  @description
end

#esnInteger

The Electronic Serial Number (ESN) of the device

Returns:

  • (Integer)


40
41
42
# File 'lib/verizon/models/resource_device.rb', line 40

def esn
  @esn
end

#eventretentionInteger

Data retention period

Returns:

  • (Integer)


156
157
158
# File 'lib/verizon/models/resource_device.rb', line 156

def eventretention
  @eventretention
end

#fieldsDtoFields

Fields to return needed by search

Returns:



44
45
46
# File 'lib/verizon/models/resource_device.rb', line 44

def fields
  @fields
end

#foreignidString

UUID of the ECPD account the user belongs to

Returns:

  • (String)


48
49
50
# File 'lib/verizon/models/resource_device.rb', line 48

def foreignid
  @foreignid
end

#hardwareversionString

The manufacturer’s hardware version of the device

Returns:

  • (String)


52
53
54
# File 'lib/verizon/models/resource_device.rb', line 52

def hardwareversion
  @hardwareversion
end

#iccidString

The 20-digit Integrated Circuit Card ID (SIM card ID)

Returns:

  • (String)


56
57
58
# File 'lib/verizon/models/resource_device.rb', line 56

def iccid
  @iccid
end

#idString

UUID of the user record, assigned at creation

Returns:

  • (String)


60
61
62
# File 'lib/verizon/models/resource_device.rb', line 60

def id
  @id
end

#imeiInteger

The 15-digit International Mobile Equipment ID

Returns:

  • (Integer)


64
65
66
# File 'lib/verizon/models/resource_device.rb', line 64

def imei
  @imei
end

#imsiInteger

The 64-bit International Mobile Subscriber Identity

Returns:

  • (Integer)


68
69
70
# File 'lib/verizon/models/resource_device.rb', line 68

def imsi
  @imsi
end

#lastupdatedDateTime

Timestamp of the record

Returns:

  • (DateTime)


72
73
74
# File 'lib/verizon/models/resource_device.rb', line 72

def lastupdated
  @lastupdated
end

#licensesArray[String]

licenses assigned to the device

Returns:

  • (Array[String])


76
77
78
# File 'lib/verizon/models/resource_device.rb', line 76

def licenses
  @licenses
end

#macString

The Media Access Control address of the device, listed on the device in the format XX-XX-XX-XX-XX-XX or XX:XX:XX:XX:XX:XX

Returns:

  • (String)


81
82
83
# File 'lib/verizon/models/resource_device.rb', line 81

def mac
  @mac
end

#manufacturerString

The manufacturer of the device

Returns:

  • (String)


85
86
87
# File 'lib/verizon/models/resource_device.rb', line 85

def manufacturer
  @manufacturer
end

#meidString

The 56-bit Mobile Equipment ID

Returns:

  • (String)


89
90
91
# File 'lib/verizon/models/resource_device.rb', line 89

def meid
  @meid
end

#msisdnString

The Mobile Station International Subscriber Directory Number. In the USA, this is 1+ a 10-digit phone number

Returns:

  • (String)


94
95
96
# File 'lib/verizon/models/resource_device.rb', line 94

def msisdn
  @msisdn
end

#nameString

User defined name of the record

Returns:

  • (String)


98
99
100
# File 'lib/verizon/models/resource_device.rb', line 98

def name
  @name
end

#parentdeviceidString

this field is applicable for BLE sensors. This represents the value of parent gateway device

Returns:

  • (String)


103
104
105
# File 'lib/verizon/models/resource_device.rb', line 103

def parentdeviceid
  @parentdeviceid
end

#productmodelString

The device model name

Returns:

  • (String)


107
108
109
# File 'lib/verizon/models/resource_device.rb', line 107

def productmodel
  @productmodel
end

#provideridString

The id of the provider who is responible for talking to the device

Returns:

  • (String)


111
112
113
# File 'lib/verizon/models/resource_device.rb', line 111

def providerid
  @providerid
end

#qrcodeString

The numeric value of the Quick Response (QR) code

Returns:

  • (String)


115
116
117
# File 'lib/verizon/models/resource_device.rb', line 115

def qrcode
  @qrcode
end

#refidString

The device reference ID

Returns:

  • (String)


119
120
121
# File 'lib/verizon/models/resource_device.rb', line 119

def refid
  @refid
end

#refidtypeString

The type of value represented by ‘refid`

Returns:

  • (String)


123
124
125
# File 'lib/verizon/models/resource_device.rb', line 123

def refidtype
  @refidtype
end

#serialString

The device’s serial number

Returns:

  • (String)


127
128
129
# File 'lib/verizon/models/resource_device.rb', line 127

def serial
  @serial
end

#servicesArray[String]

The device’s serial number

Returns:

  • (Array[String])


131
132
133
# File 'lib/verizon/models/resource_device.rb', line 131

def services
  @services
end

#skuString

The Stock Keeping Unit (SKU) number of the device

Returns:

  • (String)


135
136
137
# File 'lib/verizon/models/resource_device.rb', line 135

def sku
  @sku
end

#softwareversionString

the current device software version

Returns:

  • (String)


139
140
141
# File 'lib/verizon/models/resource_device.rb', line 139

def softwareversion
  @softwareversion
end

#stateString

The current status of the device or transaction and will be ‘success` or `failed`

Returns:

  • (String)


144
145
146
# File 'lib/verizon/models/resource_device.rb', line 144

def state
  @state
end

#versionString

The resource version

Returns:

  • (String)


148
149
150
# File 'lib/verizon/models/resource_device.rb', line 148

def version
  @version
end

#versionidString

The UUID of the resource version

Returns:

  • (String)


152
153
154
# File 'lib/verizon/models/resource_device.rb', line 152

def versionid
  @versionid
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
# File 'lib/verizon/models/resource_device.rb', line 288

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  createdon = if hash.key?('createdon')
                (DateTimeHelper.from_rfc3339(hash['createdon']) if hash['createdon'])
              end
  foreignid = hash.key?('foreignid') ? hash['foreignid'] : nil
  lastupdated = if hash.key?('lastupdated')
                  (DateTimeHelper.from_rfc3339(hash['lastupdated']) if hash['lastupdated'])
                end
  state = hash.key?('state') ? hash['state'] : nil
  versionid = hash.key?('versionid') ? hash['versionid'] : nil
  accountclientid =
    hash.key?('accountclientid') ? hash['accountclientid'] : SKIP
  billingaccountid =
    hash.key?('billingaccountid') ? hash['billingaccountid'] : SKIP
  chipset = hash.key?('chipset') ? hash['chipset'] : SKIP
  customdata = hash.key?('customdata') ? hash['customdata'] : SKIP
  description = hash.key?('description') ? hash['description'] : SKIP
  esn = hash.key?('esn') ? hash['esn'] : SKIP
  fields = DtoFields.from_hash(hash['fields']) if hash['fields']
  hardwareversion =
    hash.key?('hardwareversion') ? hash['hardwareversion'] : SKIP
  iccid = hash.key?('iccid') ? hash['iccid'] : SKIP
  id = hash.key?('id') ? hash['id'] : SKIP
  imei = hash.key?('imei') ? hash['imei'] : SKIP
  imsi = hash.key?('imsi') ? hash['imsi'] : SKIP
  licenses = hash.key?('licenses') ? hash['licenses'] : SKIP
  mac = hash.key?('mac') ? hash['mac'] : SKIP
  manufacturer = hash.key?('manufacturer') ? hash['manufacturer'] : SKIP
  meid = hash.key?('meid') ? hash['meid'] : SKIP
  msisdn = hash.key?('msisdn') ? hash['msisdn'] : SKIP
  name = hash.key?('name') ? hash['name'] : SKIP
  parentdeviceid =
    hash.key?('parentdeviceid') ? hash['parentdeviceid'] : SKIP
  productmodel = hash.key?('productmodel') ? hash['productmodel'] : SKIP
  providerid = hash.key?('providerid') ? hash['providerid'] : SKIP
  qrcode = hash.key?('qrcode') ? hash['qrcode'] : SKIP
  refid = hash.key?('refid') ? hash['refid'] : SKIP
  refidtype = hash.key?('refidtype') ? hash['refidtype'] : SKIP
  serial = hash.key?('serial') ? hash['serial'] : SKIP
  services = hash.key?('services') ? hash['services'] : SKIP
  sku = hash.key?('sku') ? hash['sku'] : SKIP
  softwareversion =
    hash.key?('softwareversion') ? hash['softwareversion'] : SKIP
  version = hash.key?('version') ? hash['version'] : SKIP
  eventretention =
    hash.key?('eventretention') ? hash['eventretention'] : SKIP

  # Create object from extracted values.
  ResourceDevice.new(createdon: createdon,
                     foreignid: foreignid,
                     lastupdated: lastupdated,
                     state: state,
                     versionid: versionid,
                     accountclientid: accountclientid,
                     billingaccountid: billingaccountid,
                     chipset: chipset,
                     customdata: customdata,
                     description: description,
                     esn: esn,
                     fields: fields,
                     hardwareversion: hardwareversion,
                     iccid: iccid,
                     id: id,
                     imei: imei,
                     imsi: imsi,
                     licenses: licenses,
                     mac: mac,
                     manufacturer: manufacturer,
                     meid: meid,
                     msisdn: msisdn,
                     name: name,
                     parentdeviceid: parentdeviceid,
                     productmodel: productmodel,
                     providerid: providerid,
                     qrcode: qrcode,
                     refid: refid,
                     refidtype: refidtype,
                     serial: serial,
                     services: services,
                     sku: sku,
                     softwareversion: softwareversion,
                     version: version,
                     eventretention: eventretention)
end

.namesObject

A mapping from model property names to API property names.



159
160
161
162
163
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
# File 'lib/verizon/models/resource_device.rb', line 159

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['accountclientid'] = 'accountclientid'
  @_hash['billingaccountid'] = 'billingaccountid'
  @_hash['chipset'] = 'chipset'
  @_hash['createdon'] = 'createdon'
  @_hash['customdata'] = 'customdata'
  @_hash['description'] = 'description'
  @_hash['esn'] = 'esn'
  @_hash['fields'] = 'fields'
  @_hash['foreignid'] = 'foreignid'
  @_hash['hardwareversion'] = 'hardwareversion'
  @_hash['iccid'] = 'iccid'
  @_hash['id'] = 'id'
  @_hash['imei'] = 'imei'
  @_hash['imsi'] = 'imsi'
  @_hash['lastupdated'] = 'lastupdated'
  @_hash['licenses'] = 'licenses'
  @_hash['mac'] = 'mac'
  @_hash['manufacturer'] = 'manufacturer'
  @_hash['meid'] = 'meid'
  @_hash['msisdn'] = 'msisdn'
  @_hash['name'] = 'name'
  @_hash['parentdeviceid'] = 'parentdeviceid'
  @_hash['productmodel'] = 'productmodel'
  @_hash['providerid'] = 'providerid'
  @_hash['qrcode'] = 'qrcode'
  @_hash['refid'] = 'refid'
  @_hash['refidtype'] = 'refidtype'
  @_hash['serial'] = 'serial'
  @_hash['services'] = 'services'
  @_hash['sku'] = 'sku'
  @_hash['softwareversion'] = 'softwareversion'
  @_hash['state'] = 'state'
  @_hash['version'] = 'version'
  @_hash['versionid'] = 'versionid'
  @_hash['eventretention'] = 'eventretention'
  @_hash
end

.nullablesObject

An array for nullable fields



236
237
238
# File 'lib/verizon/models/resource_device.rb', line 236

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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
# File 'lib/verizon/models/resource_device.rb', line 200

def self.optionals
  %w[
    accountclientid
    billingaccountid
    chipset
    customdata
    description
    esn
    fields
    hardwareversion
    iccid
    id
    imei
    imsi
    licenses
    mac
    manufacturer
    meid
    msisdn
    name
    parentdeviceid
    productmodel
    providerid
    qrcode
    refid
    refidtype
    serial
    services
    sku
    softwareversion
    version
    eventretention
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
# File 'lib/verizon/models/resource_device.rb', line 401

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} accountclientid: #{@accountclientid.inspect}, billingaccountid:"\
  " #{@billingaccountid.inspect}, chipset: #{@chipset.inspect}, createdon:"\
  " #{@createdon.inspect}, customdata: #{@customdata.inspect}, description:"\
  " #{@description.inspect}, esn: #{@esn.inspect}, fields: #{@fields.inspect}, foreignid:"\
  " #{@foreignid.inspect}, hardwareversion: #{@hardwareversion.inspect}, iccid:"\
  " #{@iccid.inspect}, id: #{@id.inspect}, imei: #{@imei.inspect}, imsi: #{@imsi.inspect},"\
  " lastupdated: #{@lastupdated.inspect}, licenses: #{@licenses.inspect}, mac:"\
  " #{@mac.inspect}, manufacturer: #{@manufacturer.inspect}, meid: #{@meid.inspect}, msisdn:"\
  " #{@msisdn.inspect}, name: #{@name.inspect}, parentdeviceid: #{@parentdeviceid.inspect},"\
  " productmodel: #{@productmodel.inspect}, providerid: #{@providerid.inspect}, qrcode:"\
  " #{@qrcode.inspect}, refid: #{@refid.inspect}, refidtype: #{@refidtype.inspect}, serial:"\
  " #{@serial.inspect}, services: #{@services.inspect}, sku: #{@sku.inspect}, softwareversion:"\
  " #{@softwareversion.inspect}, state: #{@state.inspect}, version: #{@version.inspect},"\
  " versionid: #{@versionid.inspect}, eventretention: #{@eventretention.inspect}>"
end

#to_custom_createdonObject



376
377
378
# File 'lib/verizon/models/resource_device.rb', line 376

def to_custom_createdon
  DateTimeHelper.to_rfc3339(createdon)
end

#to_custom_lastupdatedObject



380
381
382
# File 'lib/verizon/models/resource_device.rb', line 380

def to_custom_lastupdated
  DateTimeHelper.to_rfc3339(lastupdated)
end

#to_sObject

Provides a human-readable string representation of the object.



385
386
387
388
389
390
391
392
393
394
395
396
397
398
# File 'lib/verizon/models/resource_device.rb', line 385

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} accountclientid: #{@accountclientid}, billingaccountid:"\
  " #{@billingaccountid}, chipset: #{@chipset}, createdon: #{@createdon}, customdata:"\
  " #{@customdata}, description: #{@description}, esn: #{@esn}, fields: #{@fields}, foreignid:"\
  " #{@foreignid}, hardwareversion: #{@hardwareversion}, iccid: #{@iccid}, id: #{@id}, imei:"\
  " #{@imei}, imsi: #{@imsi}, lastupdated: #{@lastupdated}, licenses: #{@licenses}, mac:"\
  " #{@mac}, manufacturer: #{@manufacturer}, meid: #{@meid}, msisdn: #{@msisdn}, name:"\
  " #{@name}, parentdeviceid: #{@parentdeviceid}, productmodel: #{@productmodel}, providerid:"\
  " #{@providerid}, qrcode: #{@qrcode}, refid: #{@refid}, refidtype: #{@refidtype}, serial:"\
  " #{@serial}, services: #{@services}, sku: #{@sku}, softwareversion: #{@softwareversion},"\
  " state: #{@state}, version: #{@version}, versionid: #{@versionid}, eventretention:"\
  " #{@eventretention}>"
end