Class: Verizon::FirmwareUpgrade
- Defined in:
- lib/verizon/models/firmware_upgrade.rb
Overview
Array of upgrade objects with the specified status.
Instance Attribute Summary collapse
-
#account_name ⇒ String
Account identifier in “##########-#####”.
-
#device_list ⇒ Array[FirmwareUpgradeDeviceListItem]
A JSON object for each device that was included in the upgrade, showing the device IMEI, the status of the upgrade, and additional information about the status.
-
#firmware_name ⇒ String
The name of the firmware image that will be used for the upgrade.
-
#firmware_to ⇒ String
The name of the firmware version that will be on the devices after a successful upgrade.
-
#id ⇒ String
The unique identifier for this upgrade.
-
#start_date ⇒ String
The intended start date for the upgrade.
-
#status ⇒ String
The current status of the upgrade.
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(id = SKIP, account_name = SKIP, firmware_name = SKIP, firmware_to = SKIP, start_date = SKIP, status = SKIP, device_list = SKIP) ⇒ FirmwareUpgrade
constructor
A new instance of FirmwareUpgrade.
Methods inherited from BaseModel
Constructor Details
#initialize(id = SKIP, account_name = SKIP, firmware_name = SKIP, firmware_to = SKIP, start_date = SKIP, status = SKIP, device_list = SKIP) ⇒ FirmwareUpgrade
Returns a new instance of FirmwareUpgrade.
74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/verizon/models/firmware_upgrade.rb', line 74 def initialize(id = SKIP, account_name = SKIP, firmware_name = SKIP, firmware_to = SKIP, start_date = SKIP, status = SKIP, device_list = SKIP) @id = id unless id == SKIP @account_name = account_name unless account_name == SKIP @firmware_name = firmware_name unless firmware_name == SKIP @firmware_to = firmware_to unless firmware_to == SKIP @start_date = start_date unless start_date == SKIP @status = status unless status == SKIP @device_list = device_list unless device_list == SKIP end |
Instance Attribute Details
#account_name ⇒ String
Account identifier in “##########-#####”.
18 19 20 |
# File 'lib/verizon/models/firmware_upgrade.rb', line 18 def account_name @account_name end |
#device_list ⇒ Array[FirmwareUpgradeDeviceListItem]
A JSON object for each device that was included in the upgrade, showing the device IMEI, the status of the upgrade, and additional information about the status.
41 42 43 |
# File 'lib/verizon/models/firmware_upgrade.rb', line 41 def device_list @device_list end |
#firmware_name ⇒ String
The name of the firmware image that will be used for the upgrade.
22 23 24 |
# File 'lib/verizon/models/firmware_upgrade.rb', line 22 def firmware_name @firmware_name end |
#firmware_to ⇒ String
The name of the firmware version that will be on the devices after a successful upgrade.
27 28 29 |
# File 'lib/verizon/models/firmware_upgrade.rb', line 27 def firmware_to @firmware_to end |
#id ⇒ String
The unique identifier for this upgrade.
14 15 16 |
# File 'lib/verizon/models/firmware_upgrade.rb', line 14 def id @id end |
#start_date ⇒ String
The intended start date for the upgrade.
31 32 33 |
# File 'lib/verizon/models/firmware_upgrade.rb', line 31 def start_date @start_date end |
#status ⇒ String
The current status of the upgrade.
35 36 37 |
# File 'lib/verizon/models/firmware_upgrade.rb', line 35 def status @status end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/verizon/models/firmware_upgrade.rb', line 87 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : SKIP account_name = hash.key?('accountName') ? hash['accountName'] : SKIP firmware_name = hash.key?('firmwareName') ? hash['firmwareName'] : SKIP firmware_to = hash.key?('firmwareTo') ? hash['firmwareTo'] : SKIP start_date = hash.key?('startDate') ? hash['startDate'] : SKIP status = hash.key?('status') ? hash['status'] : SKIP # Parameter is an array, so we need to iterate through it device_list = nil unless hash['deviceList'].nil? device_list = [] hash['deviceList'].each do |structure| device_list << (FirmwareUpgradeDeviceListItem.from_hash(structure) if structure) end end device_list = SKIP unless hash.key?('deviceList') # Create object from extracted values. FirmwareUpgrade.new(id, account_name, firmware_name, firmware_to, start_date, status, device_list) end |
.names ⇒ Object
A mapping from model property names to API property names.
44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/verizon/models/firmware_upgrade.rb', line 44 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['account_name'] = 'accountName' @_hash['firmware_name'] = 'firmwareName' @_hash['firmware_to'] = 'firmwareTo' @_hash['start_date'] = 'startDate' @_hash['status'] = 'status' @_hash['device_list'] = 'deviceList' @_hash end |
.nullables ⇒ Object
An array for nullable fields
70 71 72 |
# File 'lib/verizon/models/firmware_upgrade.rb', line 70 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/verizon/models/firmware_upgrade.rb', line 57 def self.optionals %w[ id account_name firmware_name firmware_to start_date status device_list ] end |