Class: Verizon::FirmwareUpgradeRequest

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

Overview

Details of the firmware upgrade request.

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, firmware_name = nil, firmware_to = nil, start_date = nil, end_date = nil, device_list = nil) ⇒ FirmwareUpgradeRequest

Returns a new instance of FirmwareUpgradeRequest.



60
61
62
63
64
65
66
67
68
# File 'lib/verizon/models/firmware_upgrade_request.rb', line 60

def initialize( = nil, firmware_name = nil, firmware_to = nil,
               start_date = nil, end_date = nil, device_list = nil)
  @account_name = 
  @firmware_name = firmware_name
  @firmware_to = firmware_to
  @start_date = start_date
  @end_date = end_date
  @device_list = device_list
end

Instance Attribute Details

#account_nameString

Account identifier in “##########-#####”.

Returns:

  • (String)


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

def 
  @account_name
end

#device_listArray[String]

The IMEIs of the devices.

Returns:

  • (Array[String])


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

def device_list
  @device_list
end

#end_dateDate

The date that the upgrade ends.

Returns:

  • (Date)


32
33
34
# File 'lib/verizon/models/firmware_upgrade_request.rb', line 32

def end_date
  @end_date
end

#firmware_nameString

The name of the firmware image that will be used for the upgrade, from a GET /firmware response.

Returns:

  • (String)


19
20
21
# File 'lib/verizon/models/firmware_upgrade_request.rb', line 19

def firmware_name
  @firmware_name
end

#firmware_toString

The name of the firmware version that will be on the devices after a successful upgrade.

Returns:

  • (String)


24
25
26
# File 'lib/verizon/models/firmware_upgrade_request.rb', line 24

def firmware_to
  @firmware_to
end

#start_dateDate

The date that the upgrade begins.

Returns:

  • (Date)


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.



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/verizon/models/firmware_upgrade_request.rb', line 71

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = 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 object from extracted values.
  FirmwareUpgradeRequest.new(,
                             firmware_name,
                             firmware_to,
                             start_date,
                             end_date,
                             device_list)
end

.namesObject

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

.nullablesObject

An array for nullable fields



56
57
58
# File 'lib/verizon/models/firmware_upgrade_request.rb', line 56

def self.nullables
  []
end

.optionalsObject

An array for optional fields



51
52
53
# File 'lib/verizon/models/firmware_upgrade_request.rb', line 51

def self.optionals
  []
end