Class: Verizon::V2AccountDevice
- Defined in:
- lib/verizon/models/v2_account_device.rb
Overview
Account device information.
Instance Attribute Summary collapse
-
#app_fota_eligible ⇒ TrueClass | FalseClass
Device application FOTA capable.
-
#create_time ⇒ String
The date and time of when the device is created.
-
#device_id ⇒ String
Device identifier.
-
#distribution_type ⇒ String
LWM2M, OMD-DM or HTTP.
-
#fota_eligible ⇒ TrueClass | FalseClass
Device FOTA capable.
-
#license_assigned ⇒ TrueClass | FalseClass
License assigned device.
-
#make ⇒ String
Device make.
-
#mdn ⇒ String
MDN.
-
#model ⇒ String
Device model.
-
#refresh_time ⇒ String
The date and time of when the device is refreshed.
-
#software_list ⇒ Array[V2SoftwareInfo]
List of sofware.
-
#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 upgraded.
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, fota_eligible = nil, app_fota_eligible = nil, license_assigned = nil, distribution_type = nil, software_list = nil, create_time = SKIP, upgrade_time = SKIP, update_time = SKIP, refresh_time = SKIP) ⇒ V2AccountDevice
constructor
A new instance of V2AccountDevice.
Methods inherited from BaseModel
Constructor Details
#initialize(device_id = nil, mdn = nil, model = nil, make = nil, fota_eligible = nil, app_fota_eligible = nil, license_assigned = nil, distribution_type = nil, software_list = nil, create_time = SKIP, upgrade_time = SKIP, update_time = SKIP, refresh_time = SKIP) ⇒ V2AccountDevice
Returns a new instance of V2AccountDevice.
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/verizon/models/v2_account_device.rb', line 98 def initialize(device_id = nil, mdn = nil, model = nil, make = nil, fota_eligible = nil, app_fota_eligible = nil, license_assigned = nil, distribution_type = nil, software_list = nil, create_time = SKIP, upgrade_time = SKIP, update_time = SKIP, refresh_time = SKIP) @device_id = device_id @mdn = mdn @model = model @make = make @fota_eligible = fota_eligible @app_fota_eligible = app_fota_eligible @license_assigned = license_assigned @distribution_type = distribution_type @software_list = software_list @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
#app_fota_eligible ⇒ TrueClass | FalseClass
Device application FOTA capable.
34 35 36 |
# File 'lib/verizon/models/v2_account_device.rb', line 34 def app_fota_eligible @app_fota_eligible end |
#create_time ⇒ String
The date and time of when the device is created.
50 51 52 |
# File 'lib/verizon/models/v2_account_device.rb', line 50 def create_time @create_time end |
#device_id ⇒ String
Device identifier.
14 15 16 |
# File 'lib/verizon/models/v2_account_device.rb', line 14 def device_id @device_id end |
#distribution_type ⇒ String
LWM2M, OMD-DM or HTTP.
42 43 44 |
# File 'lib/verizon/models/v2_account_device.rb', line 42 def distribution_type @distribution_type end |
#fota_eligible ⇒ TrueClass | FalseClass
Device FOTA capable.
30 31 32 |
# File 'lib/verizon/models/v2_account_device.rb', line 30 def fota_eligible @fota_eligible end |
#license_assigned ⇒ TrueClass | FalseClass
License assigned device.
38 39 40 |
# File 'lib/verizon/models/v2_account_device.rb', line 38 def license_assigned @license_assigned end |
#make ⇒ String
Device make.
26 27 28 |
# File 'lib/verizon/models/v2_account_device.rb', line 26 def make @make end |
#mdn ⇒ String
MDN.
18 19 20 |
# File 'lib/verizon/models/v2_account_device.rb', line 18 def mdn @mdn end |
#model ⇒ String
Device model.
22 23 24 |
# File 'lib/verizon/models/v2_account_device.rb', line 22 def model @model end |
#refresh_time ⇒ String
The date and time of when the device is refreshed.
62 63 64 |
# File 'lib/verizon/models/v2_account_device.rb', line 62 def refresh_time @refresh_time end |
#software_list ⇒ Array[V2SoftwareInfo]
List of sofware.
46 47 48 |
# File 'lib/verizon/models/v2_account_device.rb', line 46 def software_list @software_list end |
#update_time ⇒ String
The date and time of when the device is updated.
58 59 60 |
# File 'lib/verizon/models/v2_account_device.rb', line 58 def update_time @update_time end |
#upgrade_time ⇒ String
The date and time of when the device firmware or software is upgraded.
54 55 56 |
# File 'lib/verizon/models/v2_account_device.rb', line 54 def upgrade_time @upgrade_time end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
119 120 121 122 123 124 125 126 127 128 129 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 163 |
# File 'lib/verizon/models/v2_account_device.rb', line 119 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 fota_eligible = hash.key?('fotaEligible') ? hash['fotaEligible'] : nil app_fota_eligible = hash.key?('appFotaEligible') ? hash['appFotaEligible'] : nil license_assigned = hash.key?('licenseAssigned') ? hash['licenseAssigned'] : nil distribution_type = hash.key?('distributionType') ? hash['distributionType'] : 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 << (V2SoftwareInfo.from_hash(structure) if structure) end end software_list = nil unless hash.key?('softwareList') 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. V2AccountDevice.new(device_id, mdn, model, make, fota_eligible, app_fota_eligible, license_assigned, distribution_type, software_list, create_time, upgrade_time, update_time, refresh_time) end |
.names ⇒ Object
A mapping from model property names to API property names.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/verizon/models/v2_account_device.rb', line 65 def self.names @_hash = {} if @_hash.nil? @_hash['device_id'] = 'deviceId' @_hash['mdn'] = 'mdn' @_hash['model'] = 'model' @_hash['make'] = 'make' @_hash['fota_eligible'] = 'fotaEligible' @_hash['app_fota_eligible'] = 'appFotaEligible' @_hash['license_assigned'] = 'licenseAssigned' @_hash['distribution_type'] = 'distributionType' @_hash['software_list'] = 'softwareList' @_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
94 95 96 |
# File 'lib/verizon/models/v2_account_device.rb', line 94 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
84 85 86 87 88 89 90 91 |
# File 'lib/verizon/models/v2_account_device.rb', line 84 def self.optionals %w[ create_time upgrade_time update_time refresh_time ] end |