Class: Verizon::ResourceDevice
- Defined in:
- lib/verizon/models/resource_device.rb
Overview
ResourceDevice Model.
Instance Attribute Summary collapse
-
#accountclientid ⇒ String
Not used in this release, future functionality.
-
#billingaccountid ⇒ String
The billing account ID.
-
#chipset ⇒ String
The Identifier of chipset used by the device.
-
#createdon ⇒ DateTime
Timestamp of the record.
-
#customdata ⇒ Hash[String, Object]
Name/value pair, where the value is client defined.
-
#description ⇒ String
a short description.
-
#esn ⇒ Integer
The Electronic Serial Number (ESN) of the device.
-
#eventretention ⇒ Integer
Data retention period.
-
#fields ⇒ DtoFields
Fields to return needed by search.
-
#foreignid ⇒ String
UUID of the ECPD account the user belongs to.
-
#hardwareversion ⇒ String
The manufacturer’s hardware version of the device.
-
#iccid ⇒ String
The 20-digit Integrated Circuit Card ID (SIM card ID).
-
#id ⇒ String
UUID of the user record, assigned at creation.
-
#imei ⇒ Integer
The 15-digit International Mobile Equipment ID.
-
#imsi ⇒ Integer
The 64-bit International Mobile Subscriber Identity.
-
#lastupdated ⇒ DateTime
Timestamp of the record.
-
#licenses ⇒ Array[String]
licenses assigned to the device.
-
#mac ⇒ String
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.
-
#manufacturer ⇒ String
The manufacturer of the device.
-
#meid ⇒ String
The 56-bit Mobile Equipment ID.
-
#msisdn ⇒ String
The Mobile Station International Subscriber Directory Number.
-
#name ⇒ String
User defined name of the record.
-
#parentdeviceid ⇒ String
this field is applicable for BLE sensors.
-
#productmodel ⇒ String
The device model name.
-
#providerid ⇒ String
The id of the provider who is responible for talking to the device.
-
#qrcode ⇒ String
The numeric value of the Quick Response (QR) code.
-
#refid ⇒ String
The device reference ID.
-
#refidtype ⇒ String
The type of value represented by ‘refid`.
-
#serial ⇒ String
The device’s serial number.
-
#services ⇒ Array[String]
The device’s serial number.
-
#sku ⇒ String
The Stock Keeping Unit (SKU) number of the device.
-
#softwareversion ⇒ String
the current device software version.
-
#state ⇒ String
The current status of the device or transaction and will be ‘success` or `failed`.
-
#version ⇒ String
The resource version.
-
#versionid ⇒ String
The UUID of the resource version.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#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
constructor
A new instance of ResourceDevice.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_createdon ⇒ Object
- #to_custom_lastupdated ⇒ Object
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
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
#accountclientid ⇒ String
Not used in this release, future functionality
15 16 17 |
# File 'lib/verizon/models/resource_device.rb', line 15 def accountclientid @accountclientid end |
#billingaccountid ⇒ String
The billing account ID. This is the same value as the Account ID
19 20 21 |
# File 'lib/verizon/models/resource_device.rb', line 19 def billingaccountid @billingaccountid end |
#chipset ⇒ String
The Identifier of chipset used by the device
23 24 25 |
# File 'lib/verizon/models/resource_device.rb', line 23 def chipset @chipset end |
#createdon ⇒ DateTime
Timestamp of the record
27 28 29 |
# File 'lib/verizon/models/resource_device.rb', line 27 def createdon @createdon end |
#customdata ⇒ Hash[String, Object]
Name/value pair, where the value is client defined. The purpose is to keep track of current state per device action.
32 33 34 |
# File 'lib/verizon/models/resource_device.rb', line 32 def customdata @customdata end |
#description ⇒ String
a short description
36 37 38 |
# File 'lib/verizon/models/resource_device.rb', line 36 def description @description end |
#esn ⇒ Integer
The Electronic Serial Number (ESN) of the device
40 41 42 |
# File 'lib/verizon/models/resource_device.rb', line 40 def esn @esn end |
#eventretention ⇒ Integer
Data retention period
156 157 158 |
# File 'lib/verizon/models/resource_device.rb', line 156 def eventretention @eventretention end |
#fields ⇒ DtoFields
Fields to return needed by search
44 45 46 |
# File 'lib/verizon/models/resource_device.rb', line 44 def fields @fields end |
#foreignid ⇒ String
UUID of the ECPD account the user belongs to
48 49 50 |
# File 'lib/verizon/models/resource_device.rb', line 48 def foreignid @foreignid end |
#hardwareversion ⇒ String
The manufacturer’s hardware version of the device
52 53 54 |
# File 'lib/verizon/models/resource_device.rb', line 52 def hardwareversion @hardwareversion end |
#iccid ⇒ String
The 20-digit Integrated Circuit Card ID (SIM card ID)
56 57 58 |
# File 'lib/verizon/models/resource_device.rb', line 56 def iccid @iccid end |
#id ⇒ String
UUID of the user record, assigned at creation
60 61 62 |
# File 'lib/verizon/models/resource_device.rb', line 60 def id @id end |
#imei ⇒ Integer
The 15-digit International Mobile Equipment ID
64 65 66 |
# File 'lib/verizon/models/resource_device.rb', line 64 def imei @imei end |
#imsi ⇒ Integer
The 64-bit International Mobile Subscriber Identity
68 69 70 |
# File 'lib/verizon/models/resource_device.rb', line 68 def imsi @imsi end |
#lastupdated ⇒ DateTime
Timestamp of the record
72 73 74 |
# File 'lib/verizon/models/resource_device.rb', line 72 def lastupdated @lastupdated end |
#licenses ⇒ Array[String]
licenses assigned to the device
76 77 78 |
# File 'lib/verizon/models/resource_device.rb', line 76 def licenses @licenses end |
#mac ⇒ String
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
81 82 83 |
# File 'lib/verizon/models/resource_device.rb', line 81 def mac @mac end |
#manufacturer ⇒ String
The manufacturer of the device
85 86 87 |
# File 'lib/verizon/models/resource_device.rb', line 85 def manufacturer @manufacturer end |
#meid ⇒ String
The 56-bit Mobile Equipment ID
89 90 91 |
# File 'lib/verizon/models/resource_device.rb', line 89 def meid @meid end |
#msisdn ⇒ String
The Mobile Station International Subscriber Directory Number. In the USA, this is 1+ a 10-digit phone number
94 95 96 |
# File 'lib/verizon/models/resource_device.rb', line 94 def msisdn @msisdn end |
#name ⇒ String
User defined name of the record
98 99 100 |
# File 'lib/verizon/models/resource_device.rb', line 98 def name @name end |
#parentdeviceid ⇒ String
this field is applicable for BLE sensors. This represents the value of parent gateway device
103 104 105 |
# File 'lib/verizon/models/resource_device.rb', line 103 def parentdeviceid @parentdeviceid end |
#productmodel ⇒ String
The device model name
107 108 109 |
# File 'lib/verizon/models/resource_device.rb', line 107 def productmodel @productmodel end |
#providerid ⇒ String
The id of the provider who is responible for talking to the device
111 112 113 |
# File 'lib/verizon/models/resource_device.rb', line 111 def providerid @providerid end |
#qrcode ⇒ String
The numeric value of the Quick Response (QR) code
115 116 117 |
# File 'lib/verizon/models/resource_device.rb', line 115 def qrcode @qrcode end |
#refid ⇒ String
The device reference ID
119 120 121 |
# File 'lib/verizon/models/resource_device.rb', line 119 def refid @refid end |
#refidtype ⇒ String
The type of value represented by ‘refid`
123 124 125 |
# File 'lib/verizon/models/resource_device.rb', line 123 def refidtype @refidtype end |
#serial ⇒ String
The device’s serial number
127 128 129 |
# File 'lib/verizon/models/resource_device.rb', line 127 def serial @serial end |
#services ⇒ Array[String]
The device’s serial number
131 132 133 |
# File 'lib/verizon/models/resource_device.rb', line 131 def services @services end |
#sku ⇒ String
The Stock Keeping Unit (SKU) number of the device
135 136 137 |
# File 'lib/verizon/models/resource_device.rb', line 135 def sku @sku end |
#softwareversion ⇒ String
the current device software version
139 140 141 |
# File 'lib/verizon/models/resource_device.rb', line 139 def softwareversion @softwareversion end |
#state ⇒ String
The current status of the device or transaction and will be ‘success` or `failed`
144 145 146 |
# File 'lib/verizon/models/resource_device.rb', line 144 def state @state end |
#version ⇒ String
The resource version
148 149 150 |
# File 'lib/verizon/models/resource_device.rb', line 148 def version @version end |
#versionid ⇒ String
The UUID of the resource version
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 |
.names ⇒ Object
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 |
.nullables ⇒ Object
An array for nullable fields
236 237 238 |
# File 'lib/verizon/models/resource_device.rb', line 236 def self.nullables [] end |
.optionals ⇒ Object
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
#inspect ⇒ Object
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_createdon ⇒ Object
376 377 378 |
# File 'lib/verizon/models/resource_device.rb', line 376 def to_custom_createdon DateTimeHelper.to_rfc3339(createdon) end |
#to_custom_lastupdated ⇒ Object
380 381 382 |
# File 'lib/verizon/models/resource_device.rb', line 380 def to_custom_lastupdated DateTimeHelper.to_rfc3339(lastupdated) end |
#to_s ⇒ Object
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 |