Class: Samsara::Types::VehicleStatsFaultCodesJ1939Lights

Inherits:
Object
  • Object
show all
Defined in:
lib/samsara_api/types/vehicle_stats_fault_codes_j_1939_lights.rb

Overview

Status of engine lights on J1939 vehicles.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(emissions_is_on:, protect_is_on:, stop_is_on:, warning_is_on:, additional_properties: nil) ⇒ Samsara::Types::VehicleStatsFaultCodesJ1939Lights



31
32
33
34
35
36
37
38
# File 'lib/samsara_api/types/vehicle_stats_fault_codes_j_1939_lights.rb', line 31

def initialize(emissions_is_on:, protect_is_on:, stop_is_on:, warning_is_on:, additional_properties: nil)
  @emissions_is_on = emissions_is_on
  @protect_is_on = protect_is_on
  @stop_is_on = stop_is_on
  @warning_is_on = warning_is_on
  @additional_properties = additional_properties
  @_field_set = { "emissionsIsOn": emissions_is_on, "protectIsOn": protect_is_on, "stopIsOn": stop_is_on, "warningIsOn": warning_is_on }
end

Instance Attribute Details

#additional_properties ⇒ OpenStruct (readonly)



18
19
20
# File 'lib/samsara_api/types/vehicle_stats_fault_codes_j_1939_lights.rb', line 18

def additional_properties
  @additional_properties
end

#emissions_is_on ⇒ Boolean (readonly)



10
11
12
# File 'lib/samsara_api/types/vehicle_stats_fault_codes_j_1939_lights.rb', line 10

def emissions_is_on
  @emissions_is_on
end

#protect_is_on ⇒ Boolean (readonly)



12
13
14
# File 'lib/samsara_api/types/vehicle_stats_fault_codes_j_1939_lights.rb', line 12

def protect_is_on
  @protect_is_on
end

#stop_is_on ⇒ Boolean (readonly)



14
15
16
# File 'lib/samsara_api/types/vehicle_stats_fault_codes_j_1939_lights.rb', line 14

def stop_is_on
  @stop_is_on
end

#warning_is_on ⇒ Boolean (readonly)



16
17
18
# File 'lib/samsara_api/types/vehicle_stats_fault_codes_j_1939_lights.rb', line 16

def warning_is_on
  @warning_is_on
end

Class Method Details

.from_json(json_object:) ⇒ Samsara::Types::VehicleStatsFaultCodesJ1939Lights



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/samsara_api/types/vehicle_stats_fault_codes_j_1939_lights.rb', line 43

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  emissions_is_on = parsed_json["emissionsIsOn"]
  protect_is_on = parsed_json["protectIsOn"]
  stop_is_on = parsed_json["stopIsOn"]
  warning_is_on = parsed_json["warningIsOn"]
  new(
    emissions_is_on: emissions_is_on,
    protect_is_on: protect_is_on,
    stop_is_on: stop_is_on,
    warning_is_on: warning_is_on,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void



70
71
72
73
74
75
# File 'lib/samsara_api/types/vehicle_stats_fault_codes_j_1939_lights.rb', line 70

def self.validate_raw(obj:)
  obj.emissions_is_on.is_a?(Boolean) != false || raise("Passed value for field obj.emissions_is_on is not the expected type, validation failed.")
  obj.protect_is_on.is_a?(Boolean) != false || raise("Passed value for field obj.protect_is_on is not the expected type, validation failed.")
  obj.stop_is_on.is_a?(Boolean) != false || raise("Passed value for field obj.stop_is_on is not the expected type, validation failed.")
  obj.warning_is_on.is_a?(Boolean) != false || raise("Passed value for field obj.warning_is_on is not the expected type, validation failed.")
end

Instance Method Details

#to_json ⇒ String



61
62
63
# File 'lib/samsara_api/types/vehicle_stats_fault_codes_j_1939_lights.rb', line 61

def to_json
  @_field_set&.to_json
end