Class: Samsara::Types::VehicleStatsResponseSpreaderGranularRate
- Inherits:
-
Object
- Object
- Samsara::Types::VehicleStatsResponseSpreaderGranularRate
- Defined in:
- lib/samsara_api/types/vehicle_stats_response_spreader_granular_rate.rb
Overview
Readings do not consider total spread rate(s) over time or distance.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#time ⇒ String
readonly
UTC timestamp in RFC 3339 format.
-
#value ⇒ Object
readonly
Readings do not consider total spread rate(s) over time or distance.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Samsara::Types::VehicleStatsResponseSpreaderGranularRate
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(time:, value:, additional_properties: nil) ⇒ Samsara::Types::VehicleStatsResponseSpreaderGranularRate constructor
- #to_json ⇒ String
Constructor Details
#initialize(time:, value:, additional_properties: nil) ⇒ Samsara::Types::VehicleStatsResponseSpreaderGranularRate
37 38 39 40 41 42 |
# File 'lib/samsara_api/types/vehicle_stats_response_spreader_granular_rate.rb', line 37 def initialize(time:, value:, additional_properties: nil) @time = time @value = value @additional_properties = additional_properties @_field_set = { "time": time, "value": value } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
22 23 24 |
# File 'lib/samsara_api/types/vehicle_stats_response_spreader_granular_rate.rb', line 22 def additional_properties @additional_properties end |
#time ⇒ String (readonly)
Returns UTC timestamp in RFC 3339 format. Example: ‘2020-01-27T07:06:25Z`.
14 15 16 |
# File 'lib/samsara_api/types/vehicle_stats_response_spreader_granular_rate.rb', line 14 def time @time end |
#value ⇒ Object (readonly)
Readings do not consider total spread rate(s) over time or distance.
20 21 22 |
# File 'lib/samsara_api/types/vehicle_stats_response_spreader_granular_rate.rb', line 20 def value @value end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::VehicleStatsResponseSpreaderGranularRate
48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/samsara_api/types/vehicle_stats_response_spreader_granular_rate.rb', line 48 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) time = parsed_json["time"] value = parsed_json["value"] new( time: time, value: value, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
72 73 74 75 |
# File 'lib/samsara_api/types/vehicle_stats_response_spreader_granular_rate.rb', line 72 def self.validate_raw(obj:) 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_response_spreader_granular_rate.rb', line 63 def to_json @_field_set&.to_json end |