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.
-
#end_date ⇒ Date
The date that the upgrade ends.
-
#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 ⇒ Date
The date that the upgrade begins.
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:, firmware_name:, firmware_to:, start_date:, end_date:, device_list:, additional_properties: nil) ⇒ FirmwareUpgradeRequest
constructor
A new instance of FirmwareUpgradeRequest.
-
#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(account_name:, firmware_name:, firmware_to:, start_date:, end_date:, device_list:, additional_properties: nil) ⇒ FirmwareUpgradeRequest
Returns a new instance of FirmwareUpgradeRequest.
60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/verizon/models/firmware_upgrade_request.rb', line 60 def initialize(account_name:, firmware_name:, firmware_to:, start_date:, end_date:, device_list:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @account_name = account_name @firmware_name = firmware_name @firmware_to = firmware_to @start_date = start_date @end_date = end_date @device_list = device_list @additional_properties = additional_properties end |
Instance Attribute Details
#account_name ⇒ String
Account identifier in “##########-#####”.
14 15 16 |
# File 'lib/verizon/models/firmware_upgrade_request.rb', line 14 def account_name @account_name end |
#device_list ⇒ Array[String]
The IMEIs of the devices.
36 37 38 |
# File 'lib/verizon/models/firmware_upgrade_request.rb', line 36 def device_list @device_list end |
#end_date ⇒ Date
The date that the upgrade ends.
32 33 34 |
# File 'lib/verizon/models/firmware_upgrade_request.rb', line 32 def end_date @end_date end |
#firmware_name ⇒ String
The name of the firmware image that will be used for the upgrade, from a GET /firmware response.
19 20 21 |
# File 'lib/verizon/models/firmware_upgrade_request.rb', line 19 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.
24 25 26 |
# File 'lib/verizon/models/firmware_upgrade_request.rb', line 24 def firmware_to @firmware_to end |
#start_date ⇒ Date
The date that the upgrade begins.
28 29 30 |
# File 'lib/verizon/models/firmware_upgrade_request.rb', line 28 def start_date @start_date end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/verizon/models/firmware_upgrade_request.rb', line 75 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 = hash.key?('startDate') ? hash['startDate'] : nil end_date = hash.key?('endDate') ? hash['endDate'] : nil device_list = hash.key?('deviceList') ? hash['deviceList'] : nil # 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. FirmwareUpgradeRequest.new(account_name: account_name, firmware_name: firmware_name, firmware_to: firmware_to, start_date: start_date, end_date: end_date, device_list: device_list, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
39 40 41 42 43 44 45 46 47 48 |
# File 'lib/verizon/models/firmware_upgrade_request.rb', line 39 def self.names @_hash = {} if @_hash.nil? @_hash['account_name'] = 'accountName' @_hash['firmware_name'] = 'firmwareName' @_hash['firmware_to'] = 'firmwareTo' @_hash['start_date'] = 'startDate' @_hash['end_date'] = 'endDate' @_hash['device_list'] = 'deviceList' @_hash end |
.nullables ⇒ Object
An array for nullable fields
56 57 58 |
# File 'lib/verizon/models/firmware_upgrade_request.rb', line 56 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
51 52 53 |
# File 'lib/verizon/models/firmware_upgrade_request.rb', line 51 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
112 113 114 115 116 117 118 |
# File 'lib/verizon/models/firmware_upgrade_request.rb', line 112 def inspect class_name = self.class.name.split('::').last "<#{class_name} account_name: #{@account_name.inspect}, firmware_name:"\ " #{@firmware_name.inspect}, firmware_to: #{@firmware_to.inspect}, start_date:"\ " #{@start_date.inspect}, end_date: #{@end_date.inspect}, device_list:"\ " #{@device_list.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
104 105 106 107 108 109 |
# File 'lib/verizon/models/firmware_upgrade_request.rb', line 104 def to_s class_name = self.class.name.split('::').last "<#{class_name} account_name: #{@account_name}, firmware_name: #{@firmware_name},"\ " firmware_to: #{@firmware_to}, start_date: #{@start_date}, end_date: #{@end_date},"\ " device_list: #{@device_list}, additional_properties: #{@additional_properties}>" end |