Class: Verizon::FirmwareUpgradeRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- Verizon::FirmwareUpgradeRequest
- Defined in:
- lib/verizon/models/firmware_upgrade_request.rb
Overview
Details of the firmware upgrade request.
Instance Attribute Summary collapse
-
#account_name ⇒ String
Account identifier in “##########-#####”.
-
#device_list ⇒ Array[String]
The IMEIs of the devices.
-
#firmware_name ⇒ String
The name of the firmware image that will be used for the upgrade, from a GET /firmware response.
-
#firmware_to ⇒ String
The name of the firmware version that will be on the devices after a successful upgrade.
-
#start_date ⇒ DateTime
The date that the upgrade should begin.
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(account_name = nil, firmware_name = nil, firmware_to = nil, start_date = nil, device_list = nil) ⇒ FirmwareUpgradeRequest
constructor
A new instance of FirmwareUpgradeRequest.
- #to_custom_start_date ⇒ Object
Methods inherited from BaseModel
Constructor Details
#initialize(account_name = nil, firmware_name = nil, firmware_to = nil, start_date = nil, device_list = nil) ⇒ FirmwareUpgradeRequest
Returns a new instance of FirmwareUpgradeRequest.
56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/verizon/models/firmware_upgrade_request.rb', line 56 def initialize(account_name = nil, firmware_name = nil, firmware_to = nil, start_date = nil, device_list = nil) @account_name = account_name @firmware_name = firmware_name @firmware_to = firmware_to @start_date = start_date @device_list = device_list end |
Instance Attribute Details
#account_name ⇒ String
Account identifier in “##########-#####”.
15 16 17 |
# File 'lib/verizon/models/firmware_upgrade_request.rb', line 15 def account_name @account_name end |
#device_list ⇒ Array[String]
The IMEIs of the devices.
33 34 35 |
# File 'lib/verizon/models/firmware_upgrade_request.rb', line 33 def device_list @device_list end |
#firmware_name ⇒ String
The name of the firmware image that will be used for the upgrade, from a GET /firmware response.
20 21 22 |
# File 'lib/verizon/models/firmware_upgrade_request.rb', line 20 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.
25 26 27 |
# File 'lib/verizon/models/firmware_upgrade_request.rb', line 25 def firmware_to @firmware_to end |
#start_date ⇒ DateTime
The date that the upgrade should begin.
29 30 31 |
# File 'lib/verizon/models/firmware_upgrade_request.rb', line 29 def start_date @start_date end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/verizon/models/firmware_upgrade_request.rb', line 69 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_name = hash.key?('accountName') ? hash['accountName'] : nil firmware_name = hash.key?('firmwareName') ? hash['firmwareName'] : nil firmware_to = hash.key?('firmwareTo') ? hash['firmwareTo'] : nil start_date = if hash.key?('startDate') (DateTimeHelper.from_rfc3339(hash['startDate']) if hash['startDate']) end device_list = hash.key?('deviceList') ? hash['deviceList'] : nil # Create object from extracted values. FirmwareUpgradeRequest.new(account_name, firmware_name, firmware_to, start_date, device_list) end |
.names ⇒ Object
A mapping from model property names to API property names.
36 37 38 39 40 41 42 43 44 |
# File 'lib/verizon/models/firmware_upgrade_request.rb', line 36 def self.names @_hash = {} if @_hash.nil? @_hash['account_name'] = 'accountName' @_hash['firmware_name'] = 'firmwareName' @_hash['firmware_to'] = 'firmwareTo' @_hash['start_date'] = 'startDate' @_hash['device_list'] = 'deviceList' @_hash end |
.nullables ⇒ Object
An array for nullable fields
52 53 54 |
# File 'lib/verizon/models/firmware_upgrade_request.rb', line 52 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
47 48 49 |
# File 'lib/verizon/models/firmware_upgrade_request.rb', line 47 def self.optionals [] end |
Instance Method Details
#to_custom_start_date ⇒ Object
89 90 91 |
# File 'lib/verizon/models/firmware_upgrade_request.rb', line 89 def to_custom_start_date DateTimeHelper.to_rfc3339(start_date) end |