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, additional_properties: nil) ⇒ FirmwareUpgrade
constructor
A new instance of FirmwareUpgrade.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(id: SKIP, account_name: SKIP, firmware_name: SKIP, firmware_to: SKIP, start_date: SKIP, status: SKIP, device_list: SKIP, additional_properties: nil) ⇒ FirmwareUpgrade
Returns a new instance of FirmwareUpgrade.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# 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, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @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 @additional_properties = additional_properties 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.
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 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/verizon/models/firmware_upgrade.rb', line 91 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 a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. FirmwareUpgrade.new(id: id, account_name: account_name, firmware_name: firmware_name, firmware_to: firmware_to, start_date: start_date, status: status, device_list: device_list, additional_properties: additional_properties) 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 |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
140 141 142 143 144 145 146 |
# File 'lib/verizon/models/firmware_upgrade.rb', line 140 def inspect class_name = self.class.name.split('::').last "<#{class_name} id: #{@id.inspect}, account_name: #{@account_name.inspect}, firmware_name:"\ " #{@firmware_name.inspect}, firmware_to: #{@firmware_to.inspect}, start_date:"\ " #{@start_date.inspect}, status: #{@status.inspect}, device_list: #{@device_list.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
131 132 133 134 135 136 137 |
# File 'lib/verizon/models/firmware_upgrade.rb', line 131 def to_s class_name = self.class.name.split('::').last "<#{class_name} id: #{@id}, account_name: #{@account_name}, firmware_name:"\ " #{@firmware_name}, firmware_to: #{@firmware_to}, start_date: #{@start_date}, status:"\ " #{@status}, device_list: #{@device_list}, additional_properties:"\ " #{@additional_properties}>" end |