Class: Samsara::Types::DriverAppNotificationObjectResponseBody
- Inherits:
-
Object
- Object
- Samsara::Types::DriverAppNotificationObjectResponseBody
- Defined in:
- lib/samsara_api/types/driver_app_notification_object_response_body.rb
Overview
Driver app notification settings
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #in_app_notification_options ⇒ Samsara::Types::InAppNotificationOptionsObjectResponseBody readonly
- #push_notification_options ⇒ Samsara::Types::PushNotificationOptionsObjectResponseBody readonly
Class Method Summary collapse
- .from_json(json_object:) ⇒ Samsara::Types::DriverAppNotificationObjectResponseBody
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(in_app_notification_options: OMIT, push_notification_options: OMIT, additional_properties: nil) ⇒ Samsara::Types::DriverAppNotificationObjectResponseBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(in_app_notification_options: OMIT, push_notification_options: OMIT, additional_properties: nil) ⇒ Samsara::Types::DriverAppNotificationObjectResponseBody
27 28 29 30 31 32 33 34 |
# File 'lib/samsara_api/types/driver_app_notification_object_response_body.rb', line 27 def initialize(in_app_notification_options: OMIT, push_notification_options: OMIT, additional_properties: nil) @in_app_notification_options = if != OMIT @push_notification_options = if != OMIT @additional_properties = additional_properties @_field_set = { "inAppNotificationOptions": , "pushNotificationOptions": }.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/driver_app_notification_object_response_body.rb', line 16 def additional_properties @additional_properties end |
#in_app_notification_options ⇒ Samsara::Types::InAppNotificationOptionsObjectResponseBody (readonly)
12 13 14 |
# File 'lib/samsara_api/types/driver_app_notification_object_response_body.rb', line 12 def @in_app_notification_options end |
#push_notification_options ⇒ Samsara::Types::PushNotificationOptionsObjectResponseBody (readonly)
14 15 16 |
# File 'lib/samsara_api/types/driver_app_notification_object_response_body.rb', line 14 def @push_notification_options end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::DriverAppNotificationObjectResponseBody
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/samsara_api/types/driver_app_notification_object_response_body.rb', line 40 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) unless parsed_json["inAppNotificationOptions"].nil? = parsed_json["inAppNotificationOptions"].to_json = Samsara::Types::InAppNotificationOptionsObjectResponseBody.from_json(json_object: ) else = nil end unless parsed_json["pushNotificationOptions"].nil? = parsed_json["pushNotificationOptions"].to_json = Samsara::Types::PushNotificationOptionsObjectResponseBody.from_json(json_object: ) else = nil end new( in_app_notification_options: , push_notification_options: , additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
74 75 76 77 |
# File 'lib/samsara_api/types/driver_app_notification_object_response_body.rb', line 74 def self.validate_raw(obj:) obj..nil? || Samsara::Types::InAppNotificationOptionsObjectResponseBody.validate_raw(obj: obj.) obj..nil? || Samsara::Types::PushNotificationOptionsObjectResponseBody.validate_raw(obj: obj.) end |
Instance Method Details
#to_json ⇒ String
65 66 67 |
# File 'lib/samsara_api/types/driver_app_notification_object_response_body.rb', line 65 def to_json @_field_set&.to_json end |