Class: Verizon::DeviceLog
- Defined in:
- lib/verizon/models/device_log.rb
Overview
Device logging information.
Instance Attribute Summary collapse
-
#binary_log_file_base64 ⇒ String
Base64-encoded contents of binary log file.
-
#binary_log_filename ⇒ String
File name of binary log file.
-
#device_id ⇒ String
Device IMEI.
-
#event_log ⇒ String
Event log.
-
#log_time ⇒ DateTime
Time of log.
-
#log_type ⇒ String
Log type (one of SoftwareUpdate, Event, UserNotification, AgentService, Wireless, WirelessWeb, MobileBroadbandModem, WindowsMDM).
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, log_time = nil, log_type = nil, event_log = nil, binary_log_file_base64 = nil, binary_log_filename = nil) ⇒ DeviceLog
constructor
A new instance of DeviceLog.
- #to_custom_log_time ⇒ Object
Methods inherited from BaseModel
Constructor Details
#initialize(device_id = nil, log_time = nil, log_type = nil, event_log = nil, binary_log_file_base64 = nil, binary_log_filename = nil) ⇒ DeviceLog
Returns a new instance of DeviceLog.
60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/verizon/models/device_log.rb', line 60 def initialize(device_id = nil, log_time = nil, log_type = nil, event_log = nil, binary_log_file_base64 = nil, binary_log_filename = nil) @device_id = device_id @log_time = log_time @log_type = log_type @event_log = event_log @binary_log_file_base64 = binary_log_file_base64 @binary_log_filename = binary_log_filename end |
Instance Attribute Details
#binary_log_file_base64 ⇒ String
Base64-encoded contents of binary log file.
32 33 34 |
# File 'lib/verizon/models/device_log.rb', line 32 def binary_log_file_base64 @binary_log_file_base64 end |
#binary_log_filename ⇒ String
File name of binary log file.
36 37 38 |
# File 'lib/verizon/models/device_log.rb', line 36 def binary_log_filename @binary_log_filename end |
#device_id ⇒ String
Device IMEI.
15 16 17 |
# File 'lib/verizon/models/device_log.rb', line 15 def device_id @device_id end |
#event_log ⇒ String
Event log.
28 29 30 |
# File 'lib/verizon/models/device_log.rb', line 28 def event_log @event_log end |
#log_time ⇒ DateTime
Time of log.
19 20 21 |
# File 'lib/verizon/models/device_log.rb', line 19 def log_time @log_time end |
#log_type ⇒ String
Log type (one of SoftwareUpdate, Event, UserNotification, AgentService, Wireless, WirelessWeb, MobileBroadbandModem, WindowsMDM).
24 25 26 |
# File 'lib/verizon/models/device_log.rb', line 24 def log_type @log_type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/verizon/models/device_log.rb', line 75 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. device_id = hash.key?('deviceId') ? hash['deviceId'] : nil log_time = if hash.key?('logTime') (DateTimeHelper.from_rfc3339(hash['logTime']) if hash['logTime']) end log_type = hash.key?('logType') ? hash['logType'] : nil event_log = hash.key?('eventLog') ? hash['eventLog'] : nil binary_log_file_base64 = hash.key?('binaryLogFileBase64') ? hash['binaryLogFileBase64'] : nil binary_log_filename = hash.key?('binaryLogFilename') ? hash['binaryLogFilename'] : nil # Create object from extracted values. DeviceLog.new(device_id, log_time, log_type, event_log, binary_log_file_base64, binary_log_filename) end |
.names ⇒ Object
A mapping from model property names to API property names.
39 40 41 42 43 44 45 46 47 48 |
# File 'lib/verizon/models/device_log.rb', line 39 def self.names @_hash = {} if @_hash.nil? @_hash['device_id'] = 'deviceId' @_hash['log_time'] = 'logTime' @_hash['log_type'] = 'logType' @_hash['event_log'] = 'eventLog' @_hash['binary_log_file_base64'] = 'binaryLogFileBase64' @_hash['binary_log_filename'] = 'binaryLogFilename' @_hash end |
.nullables ⇒ Object
An array for nullable fields
56 57 58 |
# File 'lib/verizon/models/device_log.rb', line 56 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
51 52 53 |
# File 'lib/verizon/models/device_log.rb', line 51 def self.optionals [] end |
Instance Method Details
#to_custom_log_time ⇒ Object
99 100 101 |
# File 'lib/verizon/models/device_log.rb', line 99 def to_custom_log_time DateTimeHelper.to_rfc3339(log_time) end |