Class: Verizon::DeviceFirmwareList

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/verizon/models/device_firmware_list.rb

Overview

Device Firmware Information.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

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( = nil, device_firmwar_version_list = SKIP)
  @account_name = 
  unless device_firmwar_version_list == SKIP
    @device_firmwar_version_list =
      device_firmwar_version_list
  end
end

Instance Attribute Details

#account_nameString

Account name.

Returns:

  • (String)


14
15
16
# File 'lib/verizon/models/device_firmware_list.rb', line 14

def 
  @account_name
end

#device_firmwar_version_listArray[DeviceFirmwareVersion]

List of device & firmware.

Returns:



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.
   = 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(,
                         device_firmwar_version_list)
end

.namesObject

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

.nullablesObject

An array for nullable fields



36
37
38
# File 'lib/verizon/models/device_firmware_list.rb', line 36

def self.nullables
  []
end

.optionalsObject

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