Class: Verizon::DeviceFirmwareUpgrade
- Defined in:
- lib/verizon/models/device_firmware_upgrade.rb
Overview
Firmware upgrades information.
Instance Attribute Summary collapse
-
#account_name ⇒ String
Account identifier.
-
#campaign_id ⇒ String
Campaign identifier.
-
#device_id ⇒ String
Device identifier.
-
#firmware_from ⇒ String
Old firmware version.
-
#firmware_name ⇒ String
Firmware name.
-
#firmware_to ⇒ String
New firmware version.
-
#reason ⇒ String
Software upgrade result reason.
-
#report_updated_time ⇒ String
Report updated time.
-
#start_date ⇒ Date
Firmware upgrade start date.
-
#status ⇒ String
Firmware upgrade status.
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, campaign_id = nil, account_name = nil, start_date = nil, status = nil, reason = nil, firmware_name = SKIP, firmware_from = SKIP, firmware_to = SKIP, report_updated_time = SKIP) ⇒ DeviceFirmwareUpgrade
constructor
A new instance of DeviceFirmwareUpgrade.
Methods inherited from BaseModel
Constructor Details
#initialize(device_id = nil, campaign_id = nil, account_name = nil, start_date = nil, status = nil, reason = nil, firmware_name = SKIP, firmware_from = SKIP, firmware_to = SKIP, report_updated_time = SKIP) ⇒ DeviceFirmwareUpgrade
Returns a new instance of DeviceFirmwareUpgrade.
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/verizon/models/device_firmware_upgrade.rb', line 83 def initialize(device_id = nil, campaign_id = nil, account_name = nil, start_date = nil, status = nil, reason = nil, firmware_name = SKIP, firmware_from = SKIP, firmware_to = SKIP, report_updated_time = SKIP) @device_id = device_id @campaign_id = campaign_id @account_name = account_name @firmware_name = firmware_name unless firmware_name == SKIP @firmware_from = firmware_from unless firmware_from == SKIP @firmware_to = firmware_to unless firmware_to == SKIP @start_date = start_date @status = status @reason = reason @report_updated_time = report_updated_time unless report_updated_time == SKIP end |
Instance Attribute Details
#account_name ⇒ String
Account identifier.
22 23 24 |
# File 'lib/verizon/models/device_firmware_upgrade.rb', line 22 def account_name @account_name end |
#campaign_id ⇒ String
Campaign identifier.
18 19 20 |
# File 'lib/verizon/models/device_firmware_upgrade.rb', line 18 def campaign_id @campaign_id end |
#device_id ⇒ String
Device identifier.
14 15 16 |
# File 'lib/verizon/models/device_firmware_upgrade.rb', line 14 def device_id @device_id end |
#firmware_from ⇒ String
Old firmware version.
30 31 32 |
# File 'lib/verizon/models/device_firmware_upgrade.rb', line 30 def firmware_from @firmware_from end |
#firmware_name ⇒ String
Firmware name.
26 27 28 |
# File 'lib/verizon/models/device_firmware_upgrade.rb', line 26 def firmware_name @firmware_name end |
#firmware_to ⇒ String
New firmware version.
34 35 36 |
# File 'lib/verizon/models/device_firmware_upgrade.rb', line 34 def firmware_to @firmware_to end |
#reason ⇒ String
Software upgrade result reason.
46 47 48 |
# File 'lib/verizon/models/device_firmware_upgrade.rb', line 46 def reason @reason end |
#report_updated_time ⇒ String
Report updated time.
50 51 52 |
# File 'lib/verizon/models/device_firmware_upgrade.rb', line 50 def report_updated_time @report_updated_time end |
#start_date ⇒ Date
Firmware upgrade start date.
38 39 40 |
# File 'lib/verizon/models/device_firmware_upgrade.rb', line 38 def start_date @start_date end |
#status ⇒ String
Firmware upgrade status.
42 43 44 |
# File 'lib/verizon/models/device_firmware_upgrade.rb', line 42 def status @status end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 |
# File 'lib/verizon/models/device_firmware_upgrade.rb', line 100 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. device_id = hash.key?('deviceId') ? hash['deviceId'] : nil campaign_id = hash.key?('campaignId') ? hash['campaignId'] : nil account_name = hash.key?('accountName') ? hash['accountName'] : nil start_date = hash.key?('startDate') ? hash['startDate'] : nil status = hash.key?('status') ? hash['status'] : nil reason = hash.key?('reason') ? hash['reason'] : nil firmware_name = hash.key?('firmwareName') ? hash['firmwareName'] : SKIP firmware_from = hash.key?('firmwareFrom') ? hash['firmwareFrom'] : SKIP firmware_to = hash.key?('firmwareTo') ? hash['firmwareTo'] : SKIP report_updated_time = hash.key?('reportUpdatedTime') ? hash['reportUpdatedTime'] : SKIP # Create object from extracted values. DeviceFirmwareUpgrade.new(device_id, campaign_id, account_name, start_date, status, reason, firmware_name, firmware_from, firmware_to, report_updated_time) end |
.names ⇒ Object
A mapping from model property names to API property names.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/verizon/models/device_firmware_upgrade.rb', line 53 def self.names @_hash = {} if @_hash.nil? @_hash['device_id'] = 'deviceId' @_hash['campaign_id'] = 'campaignId' @_hash['account_name'] = 'accountName' @_hash['firmware_name'] = 'firmwareName' @_hash['firmware_from'] = 'firmwareFrom' @_hash['firmware_to'] = 'firmwareTo' @_hash['start_date'] = 'startDate' @_hash['status'] = 'status' @_hash['reason'] = 'reason' @_hash['report_updated_time'] = 'reportUpdatedTime' @_hash end |
.nullables ⇒ Object
An array for nullable fields
79 80 81 |
# File 'lib/verizon/models/device_firmware_upgrade.rb', line 79 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
69 70 71 72 73 74 75 76 |
# File 'lib/verizon/models/device_firmware_upgrade.rb', line 69 def self.optionals %w[ firmware_name firmware_from firmware_to report_updated_time ] end |