Class: Verizon::DeviceUpgradeHistory
- Defined in:
- lib/verizon/models/device_upgrade_history.rb
Overview
Firmware upgrade information.
Instance Attribute Summary collapse
-
#account_name ⇒ String
The name (number) of the billing account that the device belongs to.
-
#device_id ⇒ String
Device IMEI.
-
#firmware_from ⇒ String
The firmware version that was on the device before the upgrade.
-
#firmware_to ⇒ String
The name of the firmware version that was on the device after the upgrade.
-
#id ⇒ String
The unique identifier for the upgrade.
-
#reason ⇒ String
More information about the status.
-
#start_date ⇒ String
The date of the upgrade.
-
#status ⇒ String
The status of the upgrade for this device.
-
#upgrade_start_time ⇒ String
The date and time that the upgrade actually started for this device.
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 = SKIP, id = SKIP, account_name = SKIP, firmware_from = SKIP, firmware_to = SKIP, start_date = SKIP, upgrade_start_time = SKIP, status = SKIP, reason = SKIP) ⇒ DeviceUpgradeHistory
constructor
A new instance of DeviceUpgradeHistory.
Methods inherited from BaseModel
Constructor Details
#initialize(device_id = SKIP, id = SKIP, account_name = SKIP, firmware_from = SKIP, firmware_to = SKIP, start_date = SKIP, upgrade_start_time = SKIP, status = SKIP, reason = SKIP) ⇒ DeviceUpgradeHistory
Returns a new instance of DeviceUpgradeHistory.
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/verizon/models/device_upgrade_history.rb', line 83 def initialize(device_id = SKIP, id = SKIP, account_name = SKIP, firmware_from = SKIP, firmware_to = SKIP, start_date = SKIP, upgrade_start_time = SKIP, status = SKIP, reason = SKIP) @device_id = device_id unless device_id == SKIP @id = id unless id == SKIP @account_name = account_name unless account_name == SKIP @firmware_from = firmware_from unless firmware_from == SKIP @firmware_to = firmware_to unless firmware_to == SKIP @start_date = start_date unless start_date == SKIP @upgrade_start_time = upgrade_start_time unless upgrade_start_time == SKIP @status = status unless status == SKIP @reason = reason unless reason == SKIP end |
Instance Attribute Details
#account_name ⇒ String
The name (number) of the billing account that the device belongs to.
22 23 24 |
# File 'lib/verizon/models/device_upgrade_history.rb', line 22 def account_name @account_name end |
#device_id ⇒ String
Device IMEI.
14 15 16 |
# File 'lib/verizon/models/device_upgrade_history.rb', line 14 def device_id @device_id end |
#firmware_from ⇒ String
The firmware version that was on the device before the upgrade.
26 27 28 |
# File 'lib/verizon/models/device_upgrade_history.rb', line 26 def firmware_from @firmware_from end |
#firmware_to ⇒ String
The name of the firmware version that was on the device after the upgrade.
30 31 32 |
# File 'lib/verizon/models/device_upgrade_history.rb', line 30 def firmware_to @firmware_to end |
#id ⇒ String
The unique identifier for the upgrade.
18 19 20 |
# File 'lib/verizon/models/device_upgrade_history.rb', line 18 def id @id end |
#reason ⇒ String
More information about the status.
46 47 48 |
# File 'lib/verizon/models/device_upgrade_history.rb', line 46 def reason @reason end |
#start_date ⇒ String
The date of the upgrade.
34 35 36 |
# File 'lib/verizon/models/device_upgrade_history.rb', line 34 def start_date @start_date end |
#status ⇒ String
The status of the upgrade for this device.
42 43 44 |
# File 'lib/verizon/models/device_upgrade_history.rb', line 42 def status @status end |
#upgrade_start_time ⇒ String
The date and time that the upgrade actually started for this device.
38 39 40 |
# File 'lib/verizon/models/device_upgrade_history.rb', line 38 def upgrade_start_time @upgrade_start_time end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/verizon/models/device_upgrade_history.rb', line 104 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. device_id = hash.key?('deviceId') ? hash['deviceId'] : SKIP id = hash.key?('id') ? hash['id'] : SKIP account_name = hash.key?('accountName') ? hash['accountName'] : SKIP firmware_from = hash.key?('firmwareFrom') ? hash['firmwareFrom'] : SKIP firmware_to = hash.key?('firmwareTo') ? hash['firmwareTo'] : SKIP start_date = hash.key?('startDate') ? hash['startDate'] : SKIP upgrade_start_time = hash.key?('upgradeStartTime') ? hash['upgradeStartTime'] : SKIP status = hash.key?('status') ? hash['status'] : SKIP reason = hash.key?('reason') ? hash['reason'] : SKIP # Create object from extracted values. DeviceUpgradeHistory.new(device_id, id, account_name, firmware_from, firmware_to, start_date, upgrade_start_time, status, reason) end |
.names ⇒ Object
A mapping from model property names to API property names.
49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/verizon/models/device_upgrade_history.rb', line 49 def self.names @_hash = {} if @_hash.nil? @_hash['device_id'] = 'deviceId' @_hash['id'] = 'id' @_hash['account_name'] = 'accountName' @_hash['firmware_from'] = 'firmwareFrom' @_hash['firmware_to'] = 'firmwareTo' @_hash['start_date'] = 'startDate' @_hash['upgrade_start_time'] = 'upgradeStartTime' @_hash['status'] = 'status' @_hash['reason'] = 'reason' @_hash end |
.nullables ⇒ Object
An array for nullable fields
79 80 81 |
# File 'lib/verizon/models/device_upgrade_history.rb', line 79 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/verizon/models/device_upgrade_history.rb', line 64 def self.optionals %w[ device_id id account_name firmware_from firmware_to start_date upgrade_start_time status reason ] end |