Class: Samsara::Types::MobileUsageDetectionAlertSettingsObjectResponseBody
- Inherits:
-
Object
- Object
- Samsara::Types::MobileUsageDetectionAlertSettingsObjectResponseBody
- Defined in:
- lib/samsara_api/types/mobile_usage_detection_alert_settings_object_response_body.rb
Overview
Enables AI detection of mobile usage events.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#has_in_cab_audio_alerts_enabled ⇒ Boolean
readonly
Indicates whether in-cab audio alerts for mobile usage are turned on.
-
#is_enabled ⇒ Boolean
readonly
Indicates whether AI event detection for mobile usage 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::MobileUsageDetectionAlertSettingsObjectResponseBody
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(has_in_cab_audio_alerts_enabled: OMIT, is_enabled: OMIT, speeding_threshold_mph: OMIT, additional_properties: nil) ⇒ Samsara::Types::MobileUsageDetectionAlertSettingsObjectResponseBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(has_in_cab_audio_alerts_enabled: OMIT, is_enabled: OMIT, speeding_threshold_mph: OMIT, additional_properties: nil) ⇒ Samsara::Types::MobileUsageDetectionAlertSettingsObjectResponseBody
28 29 30 31 32 33 34 35 36 |
# File 'lib/samsara_api/types/mobile_usage_detection_alert_settings_object_response_body.rb', line 28 def initialize(has_in_cab_audio_alerts_enabled: OMIT, is_enabled: OMIT, speeding_threshold_mph: OMIT, additional_properties: nil) @has_in_cab_audio_alerts_enabled = has_in_cab_audio_alerts_enabled if has_in_cab_audio_alerts_enabled != OMIT @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 = { "hasInCabAudioAlertsEnabled": has_in_cab_audio_alerts_enabled, "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.
16 17 18 |
# File 'lib/samsara_api/types/mobile_usage_detection_alert_settings_object_response_body.rb', line 16 def additional_properties @additional_properties end |
#has_in_cab_audio_alerts_enabled ⇒ Boolean (readonly)
Returns Indicates whether in-cab audio alerts for mobile usage are turned on.
10 11 12 |
# File 'lib/samsara_api/types/mobile_usage_detection_alert_settings_object_response_body.rb', line 10 def has_in_cab_audio_alerts_enabled @has_in_cab_audio_alerts_enabled end |
#is_enabled ⇒ Boolean (readonly)
Returns Indicates whether AI event detection for mobile usage is turned on.
12 13 14 |
# File 'lib/samsara_api/types/mobile_usage_detection_alert_settings_object_response_body.rb', line 12 def is_enabled @is_enabled end |
#speeding_threshold_mph ⇒ Float (readonly)
Returns Alert when speed is over this many miles per hour.
14 15 16 |
# File 'lib/samsara_api/types/mobile_usage_detection_alert_settings_object_response_body.rb', line 14 def speeding_threshold_mph @speeding_threshold_mph end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::MobileUsageDetectionAlertSettingsObjectResponseBody
42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/samsara_api/types/mobile_usage_detection_alert_settings_object_response_body.rb', line 42 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) has_in_cab_audio_alerts_enabled = parsed_json["hasInCabAudioAlertsEnabled"] is_enabled = parsed_json["isEnabled"] speeding_threshold_mph = parsed_json["speedingThresholdMph"] new( has_in_cab_audio_alerts_enabled: has_in_cab_audio_alerts_enabled, is_enabled: is_enabled, speeding_threshold_mph: speeding_threshold_mph, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
68 69 70 71 72 |
# File 'lib/samsara_api/types/mobile_usage_detection_alert_settings_object_response_body.rb', line 68 def self.validate_raw(obj:) obj.has_in_cab_audio_alerts_enabled&.is_a?(Boolean) != false || raise("Passed value for field obj.has_in_cab_audio_alerts_enabled is not the expected type, validation failed.") 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
59 60 61 |
# File 'lib/samsara_api/types/mobile_usage_detection_alert_settings_object_response_body.rb', line 59 def to_json @_field_set&.to_json end |