Class: Verizon::DeviceFirmwareVersion
- Defined in:
- lib/verizon/models/device_firmware_version.rb
Overview
Device and firmware information.
Instance Attribute Summary collapse
-
#device_id ⇒ String
Device IMEI.
-
#firmware_version ⇒ String
Device Firmware Version.
-
#firmware_version_update_time ⇒ DateTime
Device Firmware Version.
-
#reason ⇒ String
TODO: Write general description for this method.
-
#status ⇒ String
TODO: Write general description for this method.
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(device_id = nil, firmware_version = nil, status = SKIP, reason = SKIP, firmware_version_update_time = SKIP) ⇒ DeviceFirmwareVersion
constructor
A new instance of DeviceFirmwareVersion.
- #to_custom_firmware_version_update_time ⇒ Object
Methods inherited from BaseModel
Constructor Details
#initialize(device_id = nil, firmware_version = nil, status = SKIP, reason = SKIP, firmware_version_update_time = SKIP) ⇒ DeviceFirmwareVersion
Returns a new instance of DeviceFirmwareVersion.
58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/verizon/models/device_firmware_version.rb', line 58 def initialize(device_id = nil, firmware_version = nil, status = SKIP, reason = SKIP, firmware_version_update_time = SKIP) @status = status unless status == SKIP @reason = reason unless reason == SKIP @device_id = device_id @firmware_version = firmware_version unless firmware_version_update_time == SKIP @firmware_version_update_time = firmware_version_update_time end end |
Instance Attribute Details
#device_id ⇒ String
Device IMEI.
23 24 25 |
# File 'lib/verizon/models/device_firmware_version.rb', line 23 def device_id @device_id end |
#firmware_version ⇒ String
Device Firmware Version.
27 28 29 |
# File 'lib/verizon/models/device_firmware_version.rb', line 27 def firmware_version @firmware_version end |
#firmware_version_update_time ⇒ DateTime
Device Firmware Version.
31 32 33 |
# File 'lib/verizon/models/device_firmware_version.rb', line 31 def firmware_version_update_time @firmware_version_update_time end |
#reason ⇒ String
TODO: Write general description for this method
19 20 21 |
# File 'lib/verizon/models/device_firmware_version.rb', line 19 def reason @reason end |
#status ⇒ String
TODO: Write general description for this method
15 16 17 |
# File 'lib/verizon/models/device_firmware_version.rb', line 15 def status @status 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 90 91 92 |
# File 'lib/verizon/models/device_firmware_version.rb', line 71 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. device_id = hash.key?('deviceId') ? hash['deviceId'] : nil firmware_version = hash.key?('firmwareVersion') ? hash['firmwareVersion'] : nil status = hash.key?('status') ? hash['status'] : SKIP reason = hash.key?('reason') ? hash['reason'] : SKIP firmware_version_update_time = if hash.key?('firmwareVersionUpdateTime') (DateTimeHelper.from_rfc3339(hash['firmwareVersionUpdateTime']) if hash['firmwareVersionUpdateTime']) else SKIP end # Create object from extracted values. DeviceFirmwareVersion.new(device_id, firmware_version, status, reason, firmware_version_update_time) end |
.names ⇒ Object
A mapping from model property names to API property names.
34 35 36 37 38 39 40 41 42 |
# File 'lib/verizon/models/device_firmware_version.rb', line 34 def self.names @_hash = {} if @_hash.nil? @_hash['status'] = 'status' @_hash['reason'] = 'reason' @_hash['device_id'] = 'deviceId' @_hash['firmware_version'] = 'firmwareVersion' @_hash['firmware_version_update_time'] = 'firmwareVersionUpdateTime' @_hash end |
.nullables ⇒ Object
An array for nullable fields
54 55 56 |
# File 'lib/verizon/models/device_firmware_version.rb', line 54 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
45 46 47 48 49 50 51 |
# File 'lib/verizon/models/device_firmware_version.rb', line 45 def self.optionals %w[ status reason firmware_version_update_time ] end |
Instance Method Details
#to_custom_firmware_version_update_time ⇒ Object
94 95 96 |
# File 'lib/verizon/models/device_firmware_version.rb', line 94 def to_custom_firmware_version_update_time DateTimeHelper.to_rfc3339(firmware_version_update_time) end |