Class: Samsara::Types::VehicleStatsFaultCodesValueObdiiMonitorStatus

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

Overview

Readings from engine sensors

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(catalyst: OMIT, comprehensive: OMIT, egr: OMIT, evap_system: OMIT, fuel: OMIT, heated_catalyst: OMIT, heated_o_2_sensor: OMIT, iso_sae_reserved: OMIT, misfire: OMIT, not_ready_count: OMIT, o_2_sensor: OMIT, secondary_air: OMIT, additional_properties: nil) ⇒ Samsara::Types::VehicleStatsFaultCodesValueObdiiMonitorStatus

Parameters:

  • additional_properties (OpenStruct) (defaults to: nil) —

    Additional properties unmapped to the current class definition



132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# File 'lib/samsara_api/types/vehicle_stats_fault_codes_value_obdii_monitor_status.rb', line 132

def initialize(catalyst: OMIT, comprehensive: OMIT, egr: OMIT, evap_system: OMIT, fuel: OMIT, heated_catalyst: OMIT, heated_o_2_sensor: OMIT, iso_sae_reserved: OMIT, misfire: OMIT, not_ready_count: OMIT, o_2_sensor: OMIT, secondary_air: OMIT, additional_properties: nil)
  @catalyst = catalyst if catalyst != OMIT
  @comprehensive = comprehensive if comprehensive != OMIT
  @egr = egr if egr != OMIT
  @evap_system = evap_system if evap_system != OMIT
  @fuel = fuel if fuel != OMIT
  @heated_catalyst = heated_catalyst if heated_catalyst != OMIT
  @heated_o_2_sensor = heated_o_2_sensor if heated_o_2_sensor != OMIT
  @iso_sae_reserved = iso_sae_reserved if iso_sae_reserved != OMIT
  @misfire = misfire if misfire != OMIT
  @not_ready_count = not_ready_count if not_ready_count != OMIT
  @o_2_sensor = o_2_sensor if o_2_sensor != OMIT
  @secondary_air = secondary_air if secondary_air != OMIT
  @additional_properties = additional_properties
  @_field_set = { "catalyst": catalyst, "comprehensive": comprehensive, "egr": egr, "evapSystem": evap_system, "fuel": fuel, "heatedCatalyst": heated_catalyst, "heatedO2Sensor": heated_o_2_sensor, "isoSaeReserved": iso_sae_reserved, "misfire": misfire, "notReadyCount": not_ready_count, "o2Sensor": o_2_sensor, "secondaryAir": secondary_air }.reject do | _k, v |
  v == OMIT
end
end

Instance Attribute Details

#additional_properties ⇒ OpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct) —

    Additional properties unmapped to the current class definition



78
79
80
# File 'lib/samsara_api/types/vehicle_stats_fault_codes_value_obdii_monitor_status.rb', line 78

def additional_properties
  @additional_properties
end

#catalyst ⇒ Object (readonly)

-R: Complete



24
25
26
# File 'lib/samsara_api/types/vehicle_stats_fault_codes_value_obdii_monitor_status.rb', line 24

def catalyst
  @catalyst
end

#comprehensive ⇒ Object (readonly)

-R: Complete



29
30
31
# File 'lib/samsara_api/types/vehicle_stats_fault_codes_value_obdii_monitor_status.rb', line 29

def comprehensive
  @comprehensive
end

#egr ⇒ Object (readonly)

-R: Complete



34
35
36
# File 'lib/samsara_api/types/vehicle_stats_fault_codes_value_obdii_monitor_status.rb', line 34

def egr
  @egr
end

#evap_system ⇒ Object (readonly)

-R: Complete



39
40
41
# File 'lib/samsara_api/types/vehicle_stats_fault_codes_value_obdii_monitor_status.rb', line 39

def evap_system
  @evap_system
end

#fuel ⇒ Object (readonly)

-R: Complete



44
45
46
# File 'lib/samsara_api/types/vehicle_stats_fault_codes_value_obdii_monitor_status.rb', line 44

def fuel
  @fuel
end

#heated_catalyst ⇒ Object (readonly)

-R: Complete



49
50
51
# File 'lib/samsara_api/types/vehicle_stats_fault_codes_value_obdii_monitor_status.rb', line 49

def heated_catalyst
  @heated_catalyst
end

#heated_o_2_sensor ⇒ Object (readonly)

-R: Complete



54
55
56
# File 'lib/samsara_api/types/vehicle_stats_fault_codes_value_obdii_monitor_status.rb', line 54

def heated_o_2_sensor
  @heated_o_2_sensor
end

#iso_sae_reserved ⇒ Object (readonly)

-R: Complete



59
60
61
# File 'lib/samsara_api/types/vehicle_stats_fault_codes_value_obdii_monitor_status.rb', line 59

def iso_sae_reserved
  @iso_sae_reserved
end

#misfire ⇒ Object (readonly)

-R: Complete



64
65
66
# File 'lib/samsara_api/types/vehicle_stats_fault_codes_value_obdii_monitor_status.rb', line 64

def misfire
  @misfire
end

#not_ready_count ⇒ Integer (readonly)

Returns Count of the number of sensors reporting N: Not Complete.

Returns:

  • (Integer) —

    Count of the number of sensors reporting N: Not Complete



66
67
68
# File 'lib/samsara_api/types/vehicle_stats_fault_codes_value_obdii_monitor_status.rb', line 66

def not_ready_count
  @not_ready_count
end

#o_2_sensor ⇒ Object (readonly)

-R: Complete



71
72
73
# File 'lib/samsara_api/types/vehicle_stats_fault_codes_value_obdii_monitor_status.rb', line 71

def o_2_sensor
  @o_2_sensor
end

#secondary_air ⇒ Object (readonly)

-R: Complete



76
77
78
# File 'lib/samsara_api/types/vehicle_stats_fault_codes_value_obdii_monitor_status.rb', line 76

def secondary_air
  @secondary_air
end

Class Method Details

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

Parameters:

  • json_object (String)

Returns:



155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# File 'lib/samsara_api/types/vehicle_stats_fault_codes_value_obdii_monitor_status.rb', line 155

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  catalyst = parsed_json["catalyst"]
  comprehensive = parsed_json["comprehensive"]
  egr = parsed_json["egr"]
  evap_system = parsed_json["evapSystem"]
  fuel = parsed_json["fuel"]
  heated_catalyst = parsed_json["heatedCatalyst"]
  heated_o_2_sensor = parsed_json["heatedO2Sensor"]
  iso_sae_reserved = parsed_json["isoSaeReserved"]
  misfire = parsed_json["misfire"]
  not_ready_count = parsed_json["notReadyCount"]
  o_2_sensor = parsed_json["o2Sensor"]
  secondary_air = parsed_json["secondaryAir"]
  new(
    catalyst: catalyst,
    comprehensive: comprehensive,
    egr: egr,
    evap_system: evap_system,
    fuel: fuel,
    heated_catalyst: heated_catalyst,
    heated_o_2_sensor: heated_o_2_sensor,
    iso_sae_reserved: iso_sae_reserved,
    misfire: misfire,
    not_ready_count: not_ready_count,
    o_2_sensor: o_2_sensor,
    secondary_air: secondary_air,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


199
200
201
202
203
204
205
206
207
208
209
210
211
212
# File 'lib/samsara_api/types/vehicle_stats_fault_codes_value_obdii_monitor_status.rb', line 199

def self.validate_raw(obj:)
  obj.catalyst&.is_a?(Samsara::Types::VehicleStatsFaultCodesValueObdiiMonitorStatusCatalyst) != false || raise("Passed value for field obj.catalyst is not the expected type, validation failed.")
  obj.comprehensive&.is_a?(Samsara::Types::VehicleStatsFaultCodesValueObdiiMonitorStatusComprehensive) != false || raise("Passed value for field obj.comprehensive is not the expected type, validation failed.")
  obj.egr&.is_a?(Samsara::Types::VehicleStatsFaultCodesValueObdiiMonitorStatusEgr) != false || raise("Passed value for field obj.egr is not the expected type, validation failed.")
  obj.evap_system&.is_a?(Samsara::Types::VehicleStatsFaultCodesValueObdiiMonitorStatusEvapSystem) != false || raise("Passed value for field obj.evap_system is not the expected type, validation failed.")
  obj.fuel&.is_a?(Samsara::Types::VehicleStatsFaultCodesValueObdiiMonitorStatusFuel) != false || raise("Passed value for field obj.fuel is not the expected type, validation failed.")
  obj.heated_catalyst&.is_a?(Samsara::Types::VehicleStatsFaultCodesValueObdiiMonitorStatusHeatedCatalyst) != false || raise("Passed value for field obj.heated_catalyst is not the expected type, validation failed.")
  obj.heated_o_2_sensor&.is_a?(Samsara::Types::VehicleStatsFaultCodesValueObdiiMonitorStatusHeatedO2Sensor) != false || raise("Passed value for field obj.heated_o_2_sensor is not the expected type, validation failed.")
  obj.iso_sae_reserved&.is_a?(Samsara::Types::VehicleStatsFaultCodesValueObdiiMonitorStatusIsoSaeReserved) != false || raise("Passed value for field obj.iso_sae_reserved is not the expected type, validation failed.")
  obj.misfire&.is_a?(Samsara::Types::VehicleStatsFaultCodesValueObdiiMonitorStatusMisfire) != false || raise("Passed value for field obj.misfire is not the expected type, validation failed.")
  obj.not_ready_count&.is_a?(Integer) != false || raise("Passed value for field obj.not_ready_count is not the expected type, validation failed.")
  obj.o_2_sensor&.is_a?(Samsara::Types::VehicleStatsFaultCodesValueObdiiMonitorStatusO2Sensor) != false || raise("Passed value for field obj.o_2_sensor is not the expected type, validation failed.")
  obj.secondary_air&.is_a?(Samsara::Types::VehicleStatsFaultCodesValueObdiiMonitorStatusSecondaryAir) != false || raise("Passed value for field obj.secondary_air is not the expected type, validation failed.")
end

Instance Method Details

#to_json ⇒ String

Returns:

  • (String)


190
191
192
# File 'lib/samsara_api/types/vehicle_stats_fault_codes_value_obdii_monitor_status.rb', line 190

def to_json
  @_field_set&.to_json
end