Class: Verizon::FirmwarePackage
- Defined in:
- lib/verizon/models/firmware_package.rb
Overview
Available firmware.
Instance Attribute Summary collapse
-
#firmware_from ⇒ String
Firmware from version.
-
#firmware_name ⇒ String
Firmware name.
-
#firmware_to ⇒ String
Firmware to version.
-
#launch_date ⇒ DateTime
Firmware launch date.
-
#make ⇒ String
Firmware applicable device make.
-
#model ⇒ String
Firmware applicable device model.
-
#protocol ⇒ CampaignMetaInfoProtocolEnum
Firmware protocol.
-
#release_note ⇒ String
Firmware release note.
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(firmware_name = nil, firmware_from = nil, firmware_to = nil, launch_date = nil, release_note = nil, model = nil, make = nil, protocol = CampaignMetaInfoProtocolEnum::LW_M2M) ⇒ FirmwarePackage
constructor
A new instance of FirmwarePackage.
- #to_custom_launch_date ⇒ Object
Methods inherited from BaseModel
Constructor Details
#initialize(firmware_name = nil, firmware_from = nil, firmware_to = nil, launch_date = nil, release_note = nil, model = nil, make = nil, protocol = CampaignMetaInfoProtocolEnum::LW_M2M) ⇒ FirmwarePackage
Returns a new instance of FirmwarePackage.
69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/verizon/models/firmware_package.rb', line 69 def initialize(firmware_name = nil, firmware_from = nil, firmware_to = nil, launch_date = nil, release_note = nil, model = nil, make = nil, protocol = CampaignMetaInfoProtocolEnum::LW_M2M) @firmware_name = firmware_name @firmware_from = firmware_from @firmware_to = firmware_to @launch_date = launch_date @release_note = release_note @model = model @make = make @protocol = protocol end |
Instance Attribute Details
#firmware_from ⇒ String
Firmware from version.
19 20 21 |
# File 'lib/verizon/models/firmware_package.rb', line 19 def firmware_from @firmware_from end |
#firmware_name ⇒ String
Firmware name.
15 16 17 |
# File 'lib/verizon/models/firmware_package.rb', line 15 def firmware_name @firmware_name end |
#firmware_to ⇒ String
Firmware to version.
23 24 25 |
# File 'lib/verizon/models/firmware_package.rb', line 23 def firmware_to @firmware_to end |
#launch_date ⇒ DateTime
Firmware launch date.
27 28 29 |
# File 'lib/verizon/models/firmware_package.rb', line 27 def launch_date @launch_date end |
#make ⇒ String
Firmware applicable device make.
39 40 41 |
# File 'lib/verizon/models/firmware_package.rb', line 39 def make @make end |
#model ⇒ String
Firmware applicable device model.
35 36 37 |
# File 'lib/verizon/models/firmware_package.rb', line 35 def model @model end |
#protocol ⇒ CampaignMetaInfoProtocolEnum
Firmware protocol. Valid values include: LWM2M, OMD-DM.
43 44 45 |
# File 'lib/verizon/models/firmware_package.rb', line 43 def protocol @protocol end |
#release_note ⇒ String
Firmware release note.
31 32 33 |
# File 'lib/verizon/models/firmware_package.rb', line 31 def release_note @release_note end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/verizon/models/firmware_package.rb', line 83 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. firmware_name = hash.key?('firmwareName') ? hash['firmwareName'] : nil firmware_from = hash.key?('firmwareFrom') ? hash['firmwareFrom'] : nil firmware_to = hash.key?('firmwareTo') ? hash['firmwareTo'] : nil launch_date = if hash.key?('launchDate') (DateTimeHelper.from_rfc3339(hash['launchDate']) if hash['launchDate']) end release_note = hash.key?('releaseNote') ? hash['releaseNote'] : nil model = hash.key?('model') ? hash['model'] : nil make = hash.key?('make') ? hash['make'] : nil protocol = hash['protocol'] ||= CampaignMetaInfoProtocolEnum::LW_M2M # Create object from extracted values. FirmwarePackage.new(firmware_name, firmware_from, firmware_to, launch_date, release_note, model, make, protocol) end |
.names ⇒ Object
A mapping from model property names to API property names.
46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/verizon/models/firmware_package.rb', line 46 def self.names @_hash = {} if @_hash.nil? @_hash['firmware_name'] = 'firmwareName' @_hash['firmware_from'] = 'firmwareFrom' @_hash['firmware_to'] = 'firmwareTo' @_hash['launch_date'] = 'launchDate' @_hash['release_note'] = 'releaseNote' @_hash['model'] = 'model' @_hash['make'] = 'make' @_hash['protocol'] = 'protocol' @_hash end |
.nullables ⇒ Object
An array for nullable fields
65 66 67 |
# File 'lib/verizon/models/firmware_package.rb', line 65 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
60 61 62 |
# File 'lib/verizon/models/firmware_package.rb', line 60 def self.optionals [] end |
Instance Method Details
#to_custom_launch_date ⇒ Object
109 110 111 |
# File 'lib/verizon/models/firmware_package.rb', line 109 def to_custom_launch_date DateTimeHelper.to_rfc3339(launch_date) end |