Class: Verizon::Firmware
- Defined in:
- lib/verizon/models/firmware.rb
Overview
Firmware information.
Instance Attribute Summary collapse
-
#firmware_name ⇒ String
The name of the firmware image, provided by the device manufacturer.
-
#from_version ⇒ String
The firmware version that must currently be on the device to upgrade.
-
#launch_date ⇒ DateTime
The release date of the firmware image.
-
#make ⇒ String
The device make that the firmware applies to.
-
#model ⇒ String
The device model that the firmware applies to.
-
#participant_name ⇒ String
Internal reference; can be ignored.
-
#release_note ⇒ String
Additional information about the release.
-
#to_version ⇒ String
The firmware version that will be on the device after an upgrade.
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: SKIP, participant_name: SKIP, launch_date: SKIP, release_note: SKIP, model: SKIP, make: SKIP, from_version: SKIP, to_version: SKIP, additional_properties: nil) ⇒ Firmware
constructor
A new instance of Firmware.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_launch_date ⇒ Object
-
#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(firmware_name: SKIP, participant_name: SKIP, launch_date: SKIP, release_note: SKIP, model: SKIP, make: SKIP, from_version: SKIP, to_version: SKIP, additional_properties: nil) ⇒ Firmware
Returns a new instance of Firmware.
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/verizon/models/firmware.rb', line 78 def initialize(firmware_name: SKIP, participant_name: SKIP, launch_date: SKIP, release_note: SKIP, model: SKIP, make: SKIP, from_version: SKIP, to_version: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @firmware_name = firmware_name unless firmware_name == SKIP @participant_name = participant_name unless participant_name == SKIP @launch_date = launch_date unless launch_date == SKIP @release_note = release_note unless release_note == SKIP @model = model unless model == SKIP @make = make unless make == SKIP @from_version = from_version unless from_version == SKIP @to_version = to_version unless to_version == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#firmware_name ⇒ String
The name of the firmware image, provided by the device manufacturer.
15 16 17 |
# File 'lib/verizon/models/firmware.rb', line 15 def firmware_name @firmware_name end |
#from_version ⇒ String
The firmware version that must currently be on the device to upgrade.
39 40 41 |
# File 'lib/verizon/models/firmware.rb', line 39 def from_version @from_version end |
#launch_date ⇒ DateTime
The release date of the firmware image.
23 24 25 |
# File 'lib/verizon/models/firmware.rb', line 23 def launch_date @launch_date end |
#make ⇒ String
The device make that the firmware applies to.
35 36 37 |
# File 'lib/verizon/models/firmware.rb', line 35 def make @make end |
#model ⇒ String
The device model that the firmware applies to.
31 32 33 |
# File 'lib/verizon/models/firmware.rb', line 31 def model @model end |
#participant_name ⇒ String
Internal reference; can be ignored.
19 20 21 |
# File 'lib/verizon/models/firmware.rb', line 19 def participant_name @participant_name end |
#release_note ⇒ String
Additional information about the release.
27 28 29 |
# File 'lib/verizon/models/firmware.rb', line 27 def release_note @release_note end |
#to_version ⇒ String
The firmware version that will be on the device after an upgrade.
43 44 45 |
# File 'lib/verizon/models/firmware.rb', line 43 def to_version @to_version end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
# File 'lib/verizon/models/firmware.rb', line 97 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. firmware_name = hash.key?('firmwareName') ? hash['firmwareName'] : SKIP participant_name = hash.key?('participantName') ? hash['participantName'] : SKIP launch_date = if hash.key?('launchDate') (DateTimeHelper.from_rfc3339(hash['launchDate']) if hash['launchDate']) else SKIP end release_note = hash.key?('releaseNote') ? hash['releaseNote'] : SKIP model = hash.key?('model') ? hash['model'] : SKIP make = hash.key?('make') ? hash['make'] : SKIP from_version = hash.key?('fromVersion') ? hash['fromVersion'] : SKIP to_version = hash.key?('toVersion') ? hash['toVersion'] : SKIP # 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. Firmware.new(firmware_name: firmware_name, participant_name: participant_name, launch_date: launch_date, release_note: release_note, model: model, make: make, from_version: from_version, to_version: to_version, additional_properties: additional_properties) 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.rb', line 46 def self.names @_hash = {} if @_hash.nil? @_hash['firmware_name'] = 'firmwareName' @_hash['participant_name'] = 'participantName' @_hash['launch_date'] = 'launchDate' @_hash['release_note'] = 'releaseNote' @_hash['model'] = 'model' @_hash['make'] = 'make' @_hash['from_version'] = 'fromVersion' @_hash['to_version'] = 'toVersion' @_hash end |
.nullables ⇒ Object
An array for nullable fields
74 75 76 |
# File 'lib/verizon/models/firmware.rb', line 74 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/verizon/models/firmware.rb', line 60 def self.optionals %w[ firmware_name participant_name launch_date release_note model make from_version to_version ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
148 149 150 151 152 153 154 155 |
# File 'lib/verizon/models/firmware.rb', line 148 def inspect class_name = self.class.name.split('::').last "<#{class_name} firmware_name: #{@firmware_name.inspect}, participant_name:"\ " #{@participant_name.inspect}, launch_date: #{@launch_date.inspect}, release_note:"\ " #{@release_note.inspect}, model: #{@model.inspect}, make: #{@make.inspect}, from_version:"\ " #{@from_version.inspect}, to_version: #{@to_version.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_custom_launch_date ⇒ Object
134 135 136 |
# File 'lib/verizon/models/firmware.rb', line 134 def to_custom_launch_date DateTimeHelper.to_rfc3339(launch_date) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
139 140 141 142 143 144 145 |
# File 'lib/verizon/models/firmware.rb', line 139 def to_s class_name = self.class.name.split('::').last "<#{class_name} firmware_name: #{@firmware_name}, participant_name: #{@participant_name},"\ " launch_date: #{@launch_date}, release_note: #{@release_note}, model: #{@model}, make:"\ " #{@make}, from_version: #{@from_version}, to_version: #{@to_version},"\ " additional_properties: #{@additional_properties}>" end |