Class: Samsara::Types::VehicleStatsAuxInput
- Inherits:
-
Object
- Object
- Samsara::Types::VehicleStatsAuxInput
- Defined in:
- lib/samsara_api/types/vehicle_stats_aux_input.rb
Overview
Data for auxiliary digio equipment.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #name ⇒ String readonly
- #time ⇒ String readonly
-
#value ⇒ Boolean
readonly
Boolean indicating the state of the auxiliary equipment.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(name: OMIT, time: OMIT, value: OMIT, additional_properties: nil) ⇒ Samsara::Types::VehicleStatsAuxInput constructor
- #to_json ⇒ String
Constructor Details
#initialize(name: OMIT, time: OMIT, value: OMIT, additional_properties: nil) ⇒ Samsara::Types::VehicleStatsAuxInput
28 29 30 31 32 33 34 35 36 |
# File 'lib/samsara_api/types/vehicle_stats_aux_input.rb', line 28 def initialize(name: OMIT, time: OMIT, value: OMIT, additional_properties: nil) @name = name if name != OMIT @time = time if time != OMIT @value = value if value != OMIT @additional_properties = additional_properties @_field_set = { "name": name, "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.
16 17 18 |
# File 'lib/samsara_api/types/vehicle_stats_aux_input.rb', line 16 def additional_properties @additional_properties end |
#name ⇒ String (readonly)
10 11 12 |
# File 'lib/samsara_api/types/vehicle_stats_aux_input.rb', line 10 def name @name end |
#time ⇒ String (readonly)
12 13 14 |
# File 'lib/samsara_api/types/vehicle_stats_aux_input.rb', line 12 def time @time end |
#value ⇒ Boolean (readonly)
Returns Boolean indicating the state of the auxiliary equipment.
14 15 16 |
# File 'lib/samsara_api/types/vehicle_stats_aux_input.rb', line 14 def value @value end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::VehicleStatsAuxInput
41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/samsara_api/types/vehicle_stats_aux_input.rb', line 41 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) name = parsed_json["name"] time = parsed_json["time"] value = parsed_json["value"] new( name: name, time: time, value: value, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
66 67 68 69 70 |
# File 'lib/samsara_api/types/vehicle_stats_aux_input.rb', line 66 def self.validate_raw(obj:) obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") obj.time&.is_a?(String) != false || raise("Passed value for field obj.time is not the expected type, validation failed.") obj.value&.is_a?(Boolean) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
57 58 59 |
# File 'lib/samsara_api/types/vehicle_stats_aux_input.rb', line 57 def to_json @_field_set&.to_json end |