Class: Verizon::DtoDeviceResourceIdentifier

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

Overview

Device identifiers, one or more are required

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(deveui: SKIP, deviceid: SKIP, esn: SKIP, iccid: SKIP, imei: SKIP, imsi: SKIP, mac: SKIP, manufacturer: SKIP, meid: SKIP, msisdn: SKIP, node_uuid: SKIP, qrcode: SKIP, serial: SKIP) ⇒ DtoDeviceResourceIdentifier

Returns a new instance of DtoDeviceResourceIdentifier.



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/verizon/models/dto_device_resource_identifier.rb', line 110

def initialize(deveui: SKIP, deviceid: SKIP, esn: SKIP, iccid: SKIP,
               imei: SKIP, imsi: SKIP, mac: SKIP, manufacturer: SKIP,
               meid: SKIP, msisdn: SKIP, node_uuid: SKIP, qrcode: SKIP,
               serial: SKIP)
  @deveui = deveui unless deveui == SKIP
  @deviceid = deviceid unless deviceid == SKIP
  @esn = esn unless esn == SKIP
  @iccid = iccid unless iccid == SKIP
  @imei = imei unless imei == SKIP
  @imsi = imsi unless imsi == SKIP
  @mac = mac unless mac == SKIP
  @manufacturer = manufacturer unless manufacturer == SKIP
  @meid = meid unless meid == SKIP
  @msisdn = msisdn unless msisdn == SKIP
  @node_uuid = node_uuid unless node_uuid == SKIP
  @qrcode = qrcode unless qrcode == SKIP
  @serial = serial unless serial == SKIP
end

Instance Attribute Details

#deveuiString

the IEEE EUI64 address space used to identify a device. It is supplied by the device manufacturer

Returns:

  • (String)


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

def deveui
  @deveui
end

#deviceidString

This is a UUID value of the device created when the device is onboarded

Returns:

  • (String)


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

def deviceid
  @deviceid
end

#esnInteger

The Electronic Serial Number (ESN) of the device

Returns:

  • (Integer)


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

def esn
  @esn
end

#iccidString

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

Returns:

  • (String)


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

def iccid
  @iccid
end

#imeiInteger

The 15-digit International Mobile Equipment ID

Returns:

  • (Integer)


31
32
33
# File 'lib/verizon/models/dto_device_resource_identifier.rb', line 31

def imei
  @imei
end

#imsiInteger

The 64-bit International Mobile Subscriber Identity

Returns:

  • (Integer)


35
36
37
# File 'lib/verizon/models/dto_device_resource_identifier.rb', line 35

def imsi
  @imsi
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)


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

def mac
  @mac
end

#manufacturerString

The manufacturer of the device

Returns:

  • (String)


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

def manufacturer
  @manufacturer
end

#meidString

The 56-bit Mobile Equipment ID

Returns:

  • (String)


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

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)


53
54
55
# File 'lib/verizon/models/dto_device_resource_identifier.rb', line 53

def msisdn
  @msisdn
end

#node_uuidString

The UUID of the node the device is associated with

Returns:

  • (String)


57
58
59
# File 'lib/verizon/models/dto_device_resource_identifier.rb', line 57

def node_uuid
  @node_uuid
end

#qrcodeString

The numeric value of the Quick Response (QR) code

Returns:

  • (String)


61
62
63
# File 'lib/verizon/models/dto_device_resource_identifier.rb', line 61

def qrcode
  @qrcode
end

#serialString

The device’s serial number

Returns:

  • (String)


65
66
67
# File 'lib/verizon/models/dto_device_resource_identifier.rb', line 65

def serial
  @serial
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



130
131
132
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
162
# File 'lib/verizon/models/dto_device_resource_identifier.rb', line 130

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  deveui = hash.key?('deveui') ? hash['deveui'] : SKIP
  deviceid = hash.key?('deviceid') ? hash['deviceid'] : SKIP
  esn = hash.key?('esn') ? hash['esn'] : SKIP
  iccid = hash.key?('iccid') ? hash['iccid'] : SKIP
  imei = hash.key?('imei') ? hash['imei'] : SKIP
  imsi = hash.key?('imsi') ? hash['imsi'] : 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
  node_uuid = hash.key?('node_uuid') ? hash['node_uuid'] : SKIP
  qrcode = hash.key?('qrcode') ? hash['qrcode'] : SKIP
  serial = hash.key?('serial') ? hash['serial'] : SKIP

  # Create object from extracted values.
  DtoDeviceResourceIdentifier.new(deveui: deveui,
                                  deviceid: deviceid,
                                  esn: esn,
                                  iccid: iccid,
                                  imei: imei,
                                  imsi: imsi,
                                  mac: mac,
                                  manufacturer: manufacturer,
                                  meid: meid,
                                  msisdn: msisdn,
                                  node_uuid: node_uuid,
                                  qrcode: qrcode,
                                  serial: serial)
end

.namesObject

A mapping from model property names to API property names.



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/verizon/models/dto_device_resource_identifier.rb', line 68

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['deveui'] = 'deveui'
  @_hash['deviceid'] = 'deviceid'
  @_hash['esn'] = 'esn'
  @_hash['iccid'] = 'iccid'
  @_hash['imei'] = 'imei'
  @_hash['imsi'] = 'imsi'
  @_hash['mac'] = 'mac'
  @_hash['manufacturer'] = 'manufacturer'
  @_hash['meid'] = 'meid'
  @_hash['msisdn'] = 'msisdn'
  @_hash['node_uuid'] = 'node_uuid'
  @_hash['qrcode'] = 'qrcode'
  @_hash['serial'] = 'serial'
  @_hash
end

.nullablesObject

An array for nullable fields



106
107
108
# File 'lib/verizon/models/dto_device_resource_identifier.rb', line 106

def self.nullables
  []
end

.optionalsObject

An array for optional fields



87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/verizon/models/dto_device_resource_identifier.rb', line 87

def self.optionals
  %w[
    deveui
    deviceid
    esn
    iccid
    imei
    imsi
    mac
    manufacturer
    meid
    msisdn
    node_uuid
    qrcode
    serial
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



166
167
168
169
170
171
172
# File 'lib/verizon/models/dto_device_resource_identifier.rb', line 166

def self.validate(value)
  return true if value.instance_of? self

  return false unless value.instance_of? Hash

  true
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



184
185
186
187
188
189
190
191
# File 'lib/verizon/models/dto_device_resource_identifier.rb', line 184

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} deveui: #{@deveui.inspect}, deviceid: #{@deviceid.inspect}, esn:"\
  " #{@esn.inspect}, iccid: #{@iccid.inspect}, imei: #{@imei.inspect}, imsi: #{@imsi.inspect},"\
  " mac: #{@mac.inspect}, manufacturer: #{@manufacturer.inspect}, meid: #{@meid.inspect},"\
  " msisdn: #{@msisdn.inspect}, node_uuid: #{@node_uuid.inspect}, qrcode: #{@qrcode.inspect},"\
  " serial: #{@serial.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



175
176
177
178
179
180
181
# File 'lib/verizon/models/dto_device_resource_identifier.rb', line 175

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} deveui: #{@deveui}, deviceid: #{@deviceid}, esn: #{@esn}, iccid: #{@iccid},"\
  " imei: #{@imei}, imsi: #{@imsi}, mac: #{@mac}, manufacturer: #{@manufacturer}, meid:"\
  " #{@meid}, msisdn: #{@msisdn}, node_uuid: #{@node_uuid}, qrcode: #{@qrcode}, serial:"\
  " #{@serial}>"
end