Class: Samsara::Types::DistractedDrivingDetectionAlertSettingsObjectResponseBody
- Inherits:
-
Object
- Object
- Samsara::Types::DistractedDrivingDetectionAlertSettingsObjectResponseBody
- Defined in:
- lib/samsara_api/types/distracted_driving_detection_alert_settings_object_response_body.rb
Overview
drivers’ safety score.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #inattentive_driving_detection_alerts ⇒ Samsara::Types::InattentiveDrivingDetectionAlertSettingsObjectResponseBody readonly
-
#is_enabled ⇒ Object
readonly
on.
- #mobile_usage_detection_alerts ⇒ Samsara::Types::MobileUsageDetectionAlertSettingsObjectResponseBody readonly
Class Method Summary collapse
- .from_json(json_object:) ⇒ Samsara::Types::DistractedDrivingDetectionAlertSettingsObjectResponseBody
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(inattentive_driving_detection_alerts: OMIT, is_enabled: OMIT, mobile_usage_detection_alerts: OMIT, additional_properties: nil) ⇒ Samsara::Types::DistractedDrivingDetectionAlertSettingsObjectResponseBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(inattentive_driving_detection_alerts: OMIT, is_enabled: OMIT, mobile_usage_detection_alerts: OMIT, additional_properties: nil) ⇒ Samsara::Types::DistractedDrivingDetectionAlertSettingsObjectResponseBody
34 35 36 37 38 39 40 41 42 |
# File 'lib/samsara_api/types/distracted_driving_detection_alert_settings_object_response_body.rb', line 34 def initialize(inattentive_driving_detection_alerts: OMIT, is_enabled: OMIT, mobile_usage_detection_alerts: OMIT, additional_properties: nil) @inattentive_driving_detection_alerts = inattentive_driving_detection_alerts if inattentive_driving_detection_alerts != OMIT @is_enabled = is_enabled if is_enabled != OMIT @mobile_usage_detection_alerts = mobile_usage_detection_alerts if mobile_usage_detection_alerts != OMIT @additional_properties = additional_properties @_field_set = { "inattentiveDrivingDetectionAlerts": inattentive_driving_detection_alerts, "isEnabled": is_enabled, "mobileUsageDetectionAlerts": mobile_usage_detection_alerts }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
21 22 23 |
# File 'lib/samsara_api/types/distracted_driving_detection_alert_settings_object_response_body.rb', line 21 def additional_properties @additional_properties end |
#inattentive_driving_detection_alerts ⇒ Samsara::Types::InattentiveDrivingDetectionAlertSettingsObjectResponseBody (readonly)
14 15 16 |
# File 'lib/samsara_api/types/distracted_driving_detection_alert_settings_object_response_body.rb', line 14 def inattentive_driving_detection_alerts @inattentive_driving_detection_alerts end |
#is_enabled ⇒ Object (readonly)
on.
17 18 19 |
# File 'lib/samsara_api/types/distracted_driving_detection_alert_settings_object_response_body.rb', line 17 def is_enabled @is_enabled end |
#mobile_usage_detection_alerts ⇒ Samsara::Types::MobileUsageDetectionAlertSettingsObjectResponseBody (readonly)
19 20 21 |
# File 'lib/samsara_api/types/distracted_driving_detection_alert_settings_object_response_body.rb', line 19 def mobile_usage_detection_alerts @mobile_usage_detection_alerts end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::DistractedDrivingDetectionAlertSettingsObjectResponseBody
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/samsara_api/types/distracted_driving_detection_alert_settings_object_response_body.rb', line 48 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) unless parsed_json["inattentiveDrivingDetectionAlerts"].nil? inattentive_driving_detection_alerts = parsed_json["inattentiveDrivingDetectionAlerts"].to_json inattentive_driving_detection_alerts = Samsara::Types::InattentiveDrivingDetectionAlertSettingsObjectResponseBody.from_json(json_object: inattentive_driving_detection_alerts) else inattentive_driving_detection_alerts = nil end is_enabled = parsed_json["isEnabled"] unless parsed_json["mobileUsageDetectionAlerts"].nil? mobile_usage_detection_alerts = parsed_json["mobileUsageDetectionAlerts"].to_json mobile_usage_detection_alerts = Samsara::Types::MobileUsageDetectionAlertSettingsObjectResponseBody.from_json(json_object: mobile_usage_detection_alerts) else mobile_usage_detection_alerts = nil end new( inattentive_driving_detection_alerts: inattentive_driving_detection_alerts, is_enabled: is_enabled, mobile_usage_detection_alerts: mobile_usage_detection_alerts, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
84 85 86 87 88 |
# File 'lib/samsara_api/types/distracted_driving_detection_alert_settings_object_response_body.rb', line 84 def self.validate_raw(obj:) obj.inattentive_driving_detection_alerts.nil? || Samsara::Types::InattentiveDrivingDetectionAlertSettingsObjectResponseBody.validate_raw(obj: obj.inattentive_driving_detection_alerts) obj.is_enabled&.is_a?(Boolean) != false || raise("Passed value for field obj.is_enabled is not the expected type, validation failed.") obj.mobile_usage_detection_alerts.nil? || Samsara::Types::MobileUsageDetectionAlertSettingsObjectResponseBody.validate_raw(obj: obj.mobile_usage_detection_alerts) end |
Instance Method Details
#to_json ⇒ String
75 76 77 |
# File 'lib/samsara_api/types/distracted_driving_detection_alert_settings_object_response_body.rb', line 75 def to_json @_field_set&.to_json end |