Class: Samsara::Types::RollingStopDetectionAlertSettingsObjectResponseBody
- Inherits:
-
Object
- Object
- Samsara::Types::RollingStopDetectionAlertSettingsObjectResponseBody
- Defined in:
- lib/samsara_api/types/rolling_stop_detection_alert_settings_object_response_body.rb
Overview
available in vehicles with compatible dash cams.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#is_enabled ⇒ Boolean
readonly
Indicates whether AI event detection for rolling stops is turned on.
-
#speeding_threshold_mph ⇒ Float
readonly
Alert when speed is over this many miles per hour.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Samsara::Types::RollingStopDetectionAlertSettingsObjectResponseBody
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(is_enabled: OMIT, speeding_threshold_mph: OMIT, additional_properties: nil) ⇒ Samsara::Types::RollingStopDetectionAlertSettingsObjectResponseBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(is_enabled: OMIT, speeding_threshold_mph: OMIT, additional_properties: nil) ⇒ Samsara::Types::RollingStopDetectionAlertSettingsObjectResponseBody
26 27 28 29 30 31 32 33 |
# File 'lib/samsara_api/types/rolling_stop_detection_alert_settings_object_response_body.rb', line 26 def initialize(is_enabled: OMIT, speeding_threshold_mph: OMIT, additional_properties: nil) @is_enabled = is_enabled if is_enabled != OMIT @speeding_threshold_mph = speeding_threshold_mph if speeding_threshold_mph != OMIT @additional_properties = additional_properties @_field_set = { "isEnabled": is_enabled, "speedingThresholdMph": speeding_threshold_mph }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
15 16 17 |
# File 'lib/samsara_api/types/rolling_stop_detection_alert_settings_object_response_body.rb', line 15 def additional_properties @additional_properties end |
#is_enabled ⇒ Boolean (readonly)
Returns Indicates whether AI event detection for rolling stops is turned on.
11 12 13 |
# File 'lib/samsara_api/types/rolling_stop_detection_alert_settings_object_response_body.rb', line 11 def is_enabled @is_enabled end |
#speeding_threshold_mph ⇒ Float (readonly)
Returns Alert when speed is over this many miles per hour.
13 14 15 |
# File 'lib/samsara_api/types/rolling_stop_detection_alert_settings_object_response_body.rb', line 13 def speeding_threshold_mph @speeding_threshold_mph end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::RollingStopDetectionAlertSettingsObjectResponseBody
39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/samsara_api/types/rolling_stop_detection_alert_settings_object_response_body.rb', line 39 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) is_enabled = parsed_json["isEnabled"] speeding_threshold_mph = parsed_json["speedingThresholdMph"] new( is_enabled: is_enabled, speeding_threshold_mph: speeding_threshold_mph, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
63 64 65 66 |
# File 'lib/samsara_api/types/rolling_stop_detection_alert_settings_object_response_body.rb', line 63 def self.validate_raw(obj:) obj.is_enabled&.is_a?(Boolean) != false || raise("Passed value for field obj.is_enabled is not the expected type, validation failed.") obj.speeding_threshold_mph&.is_a?(Float) != false || raise("Passed value for field obj.speeding_threshold_mph is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
54 55 56 |
# File 'lib/samsara_api/types/rolling_stop_detection_alert_settings_object_response_body.rb', line 54 def to_json @_field_set&.to_json end |