Class: Verizon::DeviceFirmwareList
- Defined in:
- lib/verizon/models/device_firmware_list.rb
Overview
Device Firmware Information.
Instance Attribute Summary collapse
-
#account_name ⇒ String
Account name.
-
#device_firmwar_version_list ⇒ Array[DeviceFirmwareVersion]
List of device & firmware.
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, device_firmwar_version_list = SKIP) ⇒ DeviceFirmwareList
constructor
A new instance of DeviceFirmwareList.
Methods inherited from BaseModel
Constructor Details
#initialize(account_name = nil, device_firmwar_version_list = SKIP) ⇒ DeviceFirmwareList
Returns a new instance of DeviceFirmwareList.
40 41 42 43 44 45 46 |
# File 'lib/verizon/models/device_firmware_list.rb', line 40 def initialize(account_name = nil, device_firmwar_version_list = SKIP) @account_name = account_name unless device_firmwar_version_list == SKIP @device_firmwar_version_list = device_firmwar_version_list end end |
Instance Attribute Details
#account_name ⇒ String
Account name.
14 15 16 |
# File 'lib/verizon/models/device_firmware_list.rb', line 14 def account_name @account_name end |
#device_firmwar_version_list ⇒ Array[DeviceFirmwareVersion]
List of device & firmware.
18 19 20 |
# File 'lib/verizon/models/device_firmware_list.rb', line 18 def device_firmwar_version_list @device_firmwar_version_list end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/verizon/models/device_firmware_list.rb', line 49 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_name = hash.key?('accountName') ? hash['accountName'] : nil # Parameter is an array, so we need to iterate through it device_firmwar_version_list = nil unless hash['deviceFirmwarVersionList'].nil? device_firmwar_version_list = [] hash['deviceFirmwarVersionList'].each do |structure| device_firmwar_version_list << (DeviceFirmwareVersion.from_hash(structure) if structure) end end device_firmwar_version_list = SKIP unless hash.key?('deviceFirmwarVersionList') # Create object from extracted values. DeviceFirmwareList.new(account_name, device_firmwar_version_list) end |
.names ⇒ Object
A mapping from model property names to API property names.
21 22 23 24 25 26 |
# File 'lib/verizon/models/device_firmware_list.rb', line 21 def self.names @_hash = {} if @_hash.nil? @_hash['account_name'] = 'accountName' @_hash['device_firmwar_version_list'] = 'deviceFirmwarVersionList' @_hash end |
.nullables ⇒ Object
An array for nullable fields
36 37 38 |
# File 'lib/verizon/models/device_firmware_list.rb', line 36 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
29 30 31 32 33 |
# File 'lib/verizon/models/device_firmware_list.rb', line 29 def self.optionals %w[ device_firmwar_version_list ] end |