Class: Samsara::Types::VehicleStatsSyntheticEngineSeconds
- Inherits:
-
Object
- Object
- Samsara::Types::VehicleStatsSyntheticEngineSeconds
- Defined in:
- lib/samsara_api/types/vehicle_stats_synthetic_engine_seconds.rb
Overview
Data for the synthetic engine seconds for the vehicle
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #decorations ⇒ Samsara::Types::VehicleStatsDecorations readonly
- #time ⇒ String readonly
- #value ⇒ Long readonly
Class Method Summary collapse
- .from_json(json_object:) ⇒ Samsara::Types::VehicleStatsSyntheticEngineSeconds
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(decorations: OMIT, time:, value:, additional_properties: nil) ⇒ Samsara::Types::VehicleStatsSyntheticEngineSeconds constructor
- #to_json ⇒ String
Constructor Details
#initialize(decorations: OMIT, time:, value:, additional_properties: nil) ⇒ Samsara::Types::VehicleStatsSyntheticEngineSeconds
29 30 31 32 33 34 35 36 37 |
# File 'lib/samsara_api/types/vehicle_stats_synthetic_engine_seconds.rb', line 29 def initialize(decorations: OMIT, time:, value:, additional_properties: nil) @decorations = decorations if decorations != OMIT @time = time @value = value @additional_properties = additional_properties @_field_set = { "decorations": decorations, "time": time, "value": value }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
17 18 19 |
# File 'lib/samsara_api/types/vehicle_stats_synthetic_engine_seconds.rb', line 17 def additional_properties @additional_properties end |
#decorations ⇒ Samsara::Types::VehicleStatsDecorations (readonly)
11 12 13 |
# File 'lib/samsara_api/types/vehicle_stats_synthetic_engine_seconds.rb', line 11 def decorations @decorations end |
#time ⇒ String (readonly)
13 14 15 |
# File 'lib/samsara_api/types/vehicle_stats_synthetic_engine_seconds.rb', line 13 def time @time end |
#value ⇒ Long (readonly)
15 16 17 |
# File 'lib/samsara_api/types/vehicle_stats_synthetic_engine_seconds.rb', line 15 def value @value end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::VehicleStatsSyntheticEngineSeconds
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/samsara_api/types/vehicle_stats_synthetic_engine_seconds.rb', line 42 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) unless parsed_json["decorations"].nil? decorations = parsed_json["decorations"].to_json decorations = Samsara::Types::VehicleStatsDecorations.from_json(json_object: decorations) else decorations = nil end time = parsed_json["time"] value = parsed_json["value"] new( decorations: decorations, time: time, value: value, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
72 73 74 75 76 |
# File 'lib/samsara_api/types/vehicle_stats_synthetic_engine_seconds.rb', line 72 def self.validate_raw(obj:) obj.decorations.nil? || Samsara::Types::VehicleStatsDecorations.validate_raw(obj: obj.decorations) obj.time.is_a?(String) != false || raise("Passed value for field obj.time is not the expected type, validation failed.") obj.value.is_a?(Long) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
63 64 65 |
# File 'lib/samsara_api/types/vehicle_stats_synthetic_engine_seconds.rb', line 63 def to_json @_field_set&.to_json end |