Class: Verizon::V3AccountDevice
- Defined in:
- lib/verizon/models/v3_account_device.rb
Overview
Device information.
Instance Attribute Summary collapse
-
#create_time ⇒ String
The date and time of when the device is created.
-
#device_id ⇒ String
Device identifier.
-
#file_list ⇒ Array[V3SoftwareInfo]
List of files.
-
#firmware ⇒ String
Device firmware version.
-
#fota_eligible ⇒ TrueClass | FalseClass
Value=true if the device software can be upgraded over the air using the Software Management Services API.
-
#license_assigned ⇒ TrueClass | FalseClass
License assigned device.
-
#make ⇒ String
Device make.
-
#mdn ⇒ String
MDN.
-
#model ⇒ String
Device model.
-
#protocol ⇒ String
Firmware protocol.
-
#refresh_time ⇒ String
The date and time of when the device is refreshed.
-
#software_list ⇒ Array[V3SoftwareInfo]
List of sofware.
-
#status ⇒ String
Device status.
-
#update_time ⇒ String
The date and time of when the device is updated.
-
#upgrade_time ⇒ String
The date and time of when the device firmware or software is updated.
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(device_id = nil, mdn = nil, model = nil, make = nil, firmware = nil, fota_eligible = nil, status = nil, license_assigned = nil, protocol = nil, software_list = nil, file_list = SKIP, create_time = SKIP, upgrade_time = SKIP, update_time = SKIP, refresh_time = SKIP) ⇒ V3AccountDevice
constructor
A new instance of V3AccountDevice.
Methods inherited from BaseModel
Constructor Details
#initialize(device_id = nil, mdn = nil, model = nil, make = nil, firmware = nil, fota_eligible = nil, status = nil, license_assigned = nil, protocol = nil, software_list = nil, file_list = SKIP, create_time = SKIP, upgrade_time = SKIP, update_time = SKIP, refresh_time = SKIP) ⇒ V3AccountDevice
Returns a new instance of V3AccountDevice.
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
# File 'lib/verizon/models/v3_account_device.rb', line 110 def initialize(device_id = nil, mdn = nil, model = nil, make = nil, firmware = nil, fota_eligible = nil, status = nil, license_assigned = nil, protocol = nil, software_list = nil, file_list = SKIP, create_time = SKIP, upgrade_time = SKIP, update_time = SKIP, refresh_time = SKIP) @device_id = device_id @mdn = mdn @model = model @make = make @firmware = firmware @fota_eligible = fota_eligible @status = status @license_assigned = license_assigned @protocol = protocol @software_list = software_list @file_list = file_list unless file_list == SKIP @create_time = create_time unless create_time == SKIP @upgrade_time = upgrade_time unless upgrade_time == SKIP @update_time = update_time unless update_time == SKIP @refresh_time = refresh_time unless refresh_time == SKIP end |
Instance Attribute Details
#create_time ⇒ String
The date and time of when the device is created.
59 60 61 |
# File 'lib/verizon/models/v3_account_device.rb', line 59 def create_time @create_time end |
#device_id ⇒ String
Device identifier.
14 15 16 |
# File 'lib/verizon/models/v3_account_device.rb', line 14 def device_id @device_id end |
#file_list ⇒ Array[V3SoftwareInfo]
List of files.
55 56 57 |
# File 'lib/verizon/models/v3_account_device.rb', line 55 def file_list @file_list end |
#firmware ⇒ String
Device firmware version.
30 31 32 |
# File 'lib/verizon/models/v3_account_device.rb', line 30 def firmware @firmware end |
#fota_eligible ⇒ TrueClass | FalseClass
Value=true if the device software can be upgraded over the air using the Software Management Services API.
35 36 37 |
# File 'lib/verizon/models/v3_account_device.rb', line 35 def fota_eligible @fota_eligible end |
#license_assigned ⇒ TrueClass | FalseClass
License assigned device.
43 44 45 |
# File 'lib/verizon/models/v3_account_device.rb', line 43 def license_assigned @license_assigned end |
#make ⇒ String
Device make.
26 27 28 |
# File 'lib/verizon/models/v3_account_device.rb', line 26 def make @make end |
#mdn ⇒ String
MDN.
18 19 20 |
# File 'lib/verizon/models/v3_account_device.rb', line 18 def mdn @mdn end |
#model ⇒ String
Device model.
22 23 24 |
# File 'lib/verizon/models/v3_account_device.rb', line 22 def model @model end |
#protocol ⇒ String
Firmware protocol. Valid values include: LWM2M, OMADM, HTTP or NONE.
47 48 49 |
# File 'lib/verizon/models/v3_account_device.rb', line 47 def protocol @protocol end |
#refresh_time ⇒ String
The date and time of when the device is refreshed.
71 72 73 |
# File 'lib/verizon/models/v3_account_device.rb', line 71 def refresh_time @refresh_time end |
#software_list ⇒ Array[V3SoftwareInfo]
List of sofware.
51 52 53 |
# File 'lib/verizon/models/v3_account_device.rb', line 51 def software_list @software_list end |
#status ⇒ String
Device status.
39 40 41 |
# File 'lib/verizon/models/v3_account_device.rb', line 39 def status @status end |
#update_time ⇒ String
The date and time of when the device is updated.
67 68 69 |
# File 'lib/verizon/models/v3_account_device.rb', line 67 def update_time @update_time end |
#upgrade_time ⇒ String
The date and time of when the device firmware or software is updated.
63 64 65 |
# File 'lib/verizon/models/v3_account_device.rb', line 63 def upgrade_time @upgrade_time end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 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 |
# File 'lib/verizon/models/v3_account_device.rb', line 133 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. device_id = hash.key?('deviceId') ? hash['deviceId'] : nil mdn = hash.key?('mdn') ? hash['mdn'] : nil model = hash.key?('model') ? hash['model'] : nil make = hash.key?('make') ? hash['make'] : nil firmware = hash.key?('firmware') ? hash['firmware'] : nil fota_eligible = hash.key?('fotaEligible') ? hash['fotaEligible'] : nil status = hash.key?('status') ? hash['status'] : nil license_assigned = hash.key?('licenseAssigned') ? hash['licenseAssigned'] : nil protocol = hash.key?('protocol') ? hash['protocol'] : nil # Parameter is an array, so we need to iterate through it software_list = nil unless hash['softwareList'].nil? software_list = [] hash['softwareList'].each do |structure| software_list << (V3SoftwareInfo.from_hash(structure) if structure) end end software_list = nil unless hash.key?('softwareList') # Parameter is an array, so we need to iterate through it file_list = nil unless hash['fileList'].nil? file_list = [] hash['fileList'].each do |structure| file_list << (V3SoftwareInfo.from_hash(structure) if structure) end end file_list = SKIP unless hash.key?('fileList') create_time = hash.key?('createTime') ? hash['createTime'] : SKIP upgrade_time = hash.key?('upgradeTime') ? hash['upgradeTime'] : SKIP update_time = hash.key?('updateTime') ? hash['updateTime'] : SKIP refresh_time = hash.key?('refreshTime') ? hash['refreshTime'] : SKIP # Create object from extracted values. V3AccountDevice.new(device_id, mdn, model, make, firmware, fota_eligible, status, license_assigned, protocol, software_list, file_list, create_time, upgrade_time, update_time, refresh_time) end |
.names ⇒ Object
A mapping from model property names to API property names.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/verizon/models/v3_account_device.rb', line 74 def self.names @_hash = {} if @_hash.nil? @_hash['device_id'] = 'deviceId' @_hash['mdn'] = 'mdn' @_hash['model'] = 'model' @_hash['make'] = 'make' @_hash['firmware'] = 'firmware' @_hash['fota_eligible'] = 'fotaEligible' @_hash['status'] = 'status' @_hash['license_assigned'] = 'licenseAssigned' @_hash['protocol'] = 'protocol' @_hash['software_list'] = 'softwareList' @_hash['file_list'] = 'fileList' @_hash['create_time'] = 'createTime' @_hash['upgrade_time'] = 'upgradeTime' @_hash['update_time'] = 'updateTime' @_hash['refresh_time'] = 'refreshTime' @_hash end |
.nullables ⇒ Object
An array for nullable fields
106 107 108 |
# File 'lib/verizon/models/v3_account_device.rb', line 106 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
95 96 97 98 99 100 101 102 103 |
# File 'lib/verizon/models/v3_account_device.rb', line 95 def self.optionals %w[ file_list create_time upgrade_time update_time refresh_time ] end |