Class: Samsara::Types::ScheduledMaintenanceOdometerTriggerDetailsObjectResponseBody
- Inherits:
-
Object
- Object
- Samsara::Types::ScheduledMaintenanceOdometerTriggerDetailsObjectResponseBody
- Defined in:
- lib/samsara_api/types/scheduled_maintenance_odometer_trigger_details_object_response_body.rb
Overview
Details specific to Scheduled Maintenance by Odometer
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#due_in_meters ⇒ Long
readonly
Alert when vehicle odometer has this many meters left until maintenance is due.
-
#schedule_id ⇒ String
readonly
The id of the maintenance schedule.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Samsara::Types::ScheduledMaintenanceOdometerTriggerDetailsObjectResponseBody
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(due_in_meters:, schedule_id:, additional_properties: nil) ⇒ Samsara::Types::ScheduledMaintenanceOdometerTriggerDetailsObjectResponseBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(due_in_meters:, schedule_id:, additional_properties: nil) ⇒ Samsara::Types::ScheduledMaintenanceOdometerTriggerDetailsObjectResponseBody
25 26 27 28 29 30 |
# File 'lib/samsara_api/types/scheduled_maintenance_odometer_trigger_details_object_response_body.rb', line 25 def initialize(due_in_meters:, schedule_id:, additional_properties: nil) @due_in_meters = due_in_meters @schedule_id = schedule_id @additional_properties = additional_properties @_field_set = { "dueInMeters": due_in_meters, "scheduleId": schedule_id } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
14 15 16 |
# File 'lib/samsara_api/types/scheduled_maintenance_odometer_trigger_details_object_response_body.rb', line 14 def additional_properties @additional_properties end |
#due_in_meters ⇒ Long (readonly)
Returns Alert when vehicle odometer has this many meters left until maintenance is due.
10 11 12 |
# File 'lib/samsara_api/types/scheduled_maintenance_odometer_trigger_details_object_response_body.rb', line 10 def due_in_meters @due_in_meters end |
#schedule_id ⇒ String (readonly)
Returns The id of the maintenance schedule.
12 13 14 |
# File 'lib/samsara_api/types/scheduled_maintenance_odometer_trigger_details_object_response_body.rb', line 12 def schedule_id @schedule_id end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::ScheduledMaintenanceOdometerTriggerDetailsObjectResponseBody
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/samsara_api/types/scheduled_maintenance_odometer_trigger_details_object_response_body.rb', line 36 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) due_in_meters = parsed_json["dueInMeters"] schedule_id = parsed_json["scheduleId"] new( due_in_meters: due_in_meters, schedule_id: schedule_id, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
60 61 62 63 |
# File 'lib/samsara_api/types/scheduled_maintenance_odometer_trigger_details_object_response_body.rb', line 60 def self.validate_raw(obj:) obj.due_in_meters.is_a?(Long) != false || raise("Passed value for field obj.due_in_meters is not the expected type, validation failed.") obj.schedule_id.is_a?(String) != false || raise("Passed value for field obj.schedule_id is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
51 52 53 |
# File 'lib/samsara_api/types/scheduled_maintenance_odometer_trigger_details_object_response_body.rb', line 51 def to_json @_field_set&.to_json end |