Class: Samsara::Types::VehicleStatsFaultCodesValueOemDiagnosticTroubleCodes
- Inherits:
-
Object
- Object
- Samsara::Types::VehicleStatsFaultCodesValueOemDiagnosticTroubleCodes
- Defined in:
- lib/samsara_api/types/vehicle_stats_fault_codes_value_oem_diagnostic_trouble_codes.rb
Overview
Proprietary diagnostic trouble code for some OEM vehicles.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#code_description ⇒ String
readonly
The OEM code description.
-
#code_identifier ⇒ String
readonly
The OEM code identifier.
-
#code_severity ⇒ String
readonly
The OEM code severity.
-
#code_source ⇒ String
readonly
The OEM code source.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Samsara::Types::VehicleStatsFaultCodesValueOemDiagnosticTroubleCodes
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(code_description: OMIT, code_identifier: OMIT, code_severity: OMIT, code_source: OMIT, additional_properties: nil) ⇒ Samsara::Types::VehicleStatsFaultCodesValueOemDiagnosticTroubleCodes constructor
- #to_json ⇒ String
Constructor Details
#initialize(code_description: OMIT, code_identifier: OMIT, code_severity: OMIT, code_source: OMIT, additional_properties: nil) ⇒ Samsara::Types::VehicleStatsFaultCodesValueOemDiagnosticTroubleCodes
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/samsara_api/types/vehicle_stats_fault_codes_value_oem_diagnostic_trouble_codes.rb', line 31 def initialize(code_description: OMIT, code_identifier: OMIT, code_severity: OMIT, code_source: OMIT, additional_properties: nil) @code_description = code_description if code_description != OMIT @code_identifier = code_identifier if code_identifier != OMIT @code_severity = code_severity if code_severity != OMIT @code_source = code_source if code_source != OMIT @additional_properties = additional_properties @_field_set = { "codeDescription": code_description, "codeIdentifier": code_identifier, "codeSeverity": code_severity, "codeSource": code_source }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
18 19 20 |
# File 'lib/samsara_api/types/vehicle_stats_fault_codes_value_oem_diagnostic_trouble_codes.rb', line 18 def additional_properties @additional_properties end |
#code_description ⇒ String (readonly)
Returns The OEM code description.
10 11 12 |
# File 'lib/samsara_api/types/vehicle_stats_fault_codes_value_oem_diagnostic_trouble_codes.rb', line 10 def code_description @code_description end |
#code_identifier ⇒ String (readonly)
Returns The OEM code identifier.
12 13 14 |
# File 'lib/samsara_api/types/vehicle_stats_fault_codes_value_oem_diagnostic_trouble_codes.rb', line 12 def code_identifier @code_identifier end |
#code_severity ⇒ String (readonly)
Returns The OEM code severity.
14 15 16 |
# File 'lib/samsara_api/types/vehicle_stats_fault_codes_value_oem_diagnostic_trouble_codes.rb', line 14 def code_severity @code_severity end |
#code_source ⇒ String (readonly)
Returns The OEM code source.
16 17 18 |
# File 'lib/samsara_api/types/vehicle_stats_fault_codes_value_oem_diagnostic_trouble_codes.rb', line 16 def code_source @code_source end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::VehicleStatsFaultCodesValueOemDiagnosticTroubleCodes
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/samsara_api/types/vehicle_stats_fault_codes_value_oem_diagnostic_trouble_codes.rb', line 46 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) code_description = parsed_json["codeDescription"] code_identifier = parsed_json["codeIdentifier"] code_severity = parsed_json["codeSeverity"] code_source = parsed_json["codeSource"] new( code_description: code_description, code_identifier: code_identifier, code_severity: code_severity, code_source: code_source, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
74 75 76 77 78 79 |
# File 'lib/samsara_api/types/vehicle_stats_fault_codes_value_oem_diagnostic_trouble_codes.rb', line 74 def self.validate_raw(obj:) obj.code_description&.is_a?(String) != false || raise("Passed value for field obj.code_description is not the expected type, validation failed.") obj.code_identifier&.is_a?(String) != false || raise("Passed value for field obj.code_identifier is not the expected type, validation failed.") obj.code_severity&.is_a?(String) != false || raise("Passed value for field obj.code_severity is not the expected type, validation failed.") obj.code_source&.is_a?(String) != false || raise("Passed value for field obj.code_source is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
65 66 67 |
# File 'lib/samsara_api/types/vehicle_stats_fault_codes_value_oem_diagnostic_trouble_codes.rb', line 65 def to_json @_field_set&.to_json end |