Class: Samsara::Types::PendingDutyStatusDurationsObjectResponseBody
- Inherits:
-
Object
- Object
- Samsara::Types::PendingDutyStatusDurationsObjectResponseBody
- Defined in:
- lib/samsara_api/types/pending_duty_status_durations_object_response_body.rb
Overview
carrier edits are accepted by the driver.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#active_duration_ms ⇒ Long
readonly
Duration the driver was active for in the log period in milliseconds.
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#drive_duration_ms ⇒ Long
readonly
Duration the driver was driving for in the log period in milliseconds.
-
#off_duty_duration_ms ⇒ Long
readonly
Duration the driver was off duty for in the log period in milliseconds.
-
#on_duty_duration_ms ⇒ Long
readonly
Duration the driver was on duty for in the log period in milliseconds.
-
#personal_conveyance_duration_ms ⇒ Object
readonly
milliseconds.
-
#sleeper_berth_duration_ms ⇒ Object
readonly
milliseconds.
-
#waiting_time_duration_ms ⇒ Long
readonly
Duration the driver was waiting for in the log period in milliseconds.
-
#yard_move_duration_ms ⇒ Object
readonly
milliseconds.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Samsara::Types::PendingDutyStatusDurationsObjectResponseBody
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(active_duration_ms: OMIT, drive_duration_ms: OMIT, off_duty_duration_ms: OMIT, on_duty_duration_ms: OMIT, personal_conveyance_duration_ms: OMIT, sleeper_berth_duration_ms: OMIT, waiting_time_duration_ms: OMIT, yard_move_duration_ms: OMIT, additional_properties: nil) ⇒ Samsara::Types::PendingDutyStatusDurationsObjectResponseBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(active_duration_ms: OMIT, drive_duration_ms: OMIT, off_duty_duration_ms: OMIT, on_duty_duration_ms: OMIT, personal_conveyance_duration_ms: OMIT, sleeper_berth_duration_ms: OMIT, waiting_time_duration_ms: OMIT, yard_move_duration_ms: OMIT, additional_properties: nil) ⇒ Samsara::Types::PendingDutyStatusDurationsObjectResponseBody
50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/samsara_api/types/pending_duty_status_durations_object_response_body.rb', line 50 def initialize(active_duration_ms: OMIT, drive_duration_ms: OMIT, off_duty_duration_ms: OMIT, on_duty_duration_ms: OMIT, personal_conveyance_duration_ms: OMIT, sleeper_berth_duration_ms: OMIT, waiting_time_duration_ms: OMIT, yard_move_duration_ms: OMIT, additional_properties: nil) @active_duration_ms = active_duration_ms if active_duration_ms != OMIT @drive_duration_ms = drive_duration_ms if drive_duration_ms != OMIT @off_duty_duration_ms = off_duty_duration_ms if off_duty_duration_ms != OMIT @on_duty_duration_ms = on_duty_duration_ms if on_duty_duration_ms != OMIT @personal_conveyance_duration_ms = personal_conveyance_duration_ms if personal_conveyance_duration_ms != OMIT @sleeper_berth_duration_ms = sleeper_berth_duration_ms if sleeper_berth_duration_ms != OMIT @waiting_time_duration_ms = waiting_time_duration_ms if waiting_time_duration_ms != OMIT @yard_move_duration_ms = yard_move_duration_ms if yard_move_duration_ms != OMIT @additional_properties = additional_properties @_field_set = { "activeDurationMs": active_duration_ms, "driveDurationMs": drive_duration_ms, "offDutyDurationMs": off_duty_duration_ms, "onDutyDurationMs": on_duty_duration_ms, "personalConveyanceDurationMs": personal_conveyance_duration_ms, "sleeperBerthDurationMs": sleeper_berth_duration_ms, "waitingTimeDurationMs": waiting_time_duration_ms, "yardMoveDurationMs": yard_move_duration_ms }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#active_duration_ms ⇒ Long (readonly)
Returns Duration the driver was active for in the log period in milliseconds.
11 12 13 |
# File 'lib/samsara_api/types/pending_duty_status_durations_object_response_body.rb', line 11 def active_duration_ms @active_duration_ms end |
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
30 31 32 |
# File 'lib/samsara_api/types/pending_duty_status_durations_object_response_body.rb', line 30 def additional_properties @additional_properties end |
#drive_duration_ms ⇒ Long (readonly)
Returns Duration the driver was driving for in the log period in milliseconds.
13 14 15 |
# File 'lib/samsara_api/types/pending_duty_status_durations_object_response_body.rb', line 13 def drive_duration_ms @drive_duration_ms end |
#off_duty_duration_ms ⇒ Long (readonly)
Returns Duration the driver was off duty for in the log period in milliseconds.
15 16 17 |
# File 'lib/samsara_api/types/pending_duty_status_durations_object_response_body.rb', line 15 def off_duty_duration_ms @off_duty_duration_ms end |
#on_duty_duration_ms ⇒ Long (readonly)
Returns Duration the driver was on duty for in the log period in milliseconds.
17 18 19 |
# File 'lib/samsara_api/types/pending_duty_status_durations_object_response_body.rb', line 17 def on_duty_duration_ms @on_duty_duration_ms end |
#personal_conveyance_duration_ms ⇒ Object (readonly)
milliseconds.
20 21 22 |
# File 'lib/samsara_api/types/pending_duty_status_durations_object_response_body.rb', line 20 def personal_conveyance_duration_ms @personal_conveyance_duration_ms end |
#sleeper_berth_duration_ms ⇒ Object (readonly)
milliseconds.
23 24 25 |
# File 'lib/samsara_api/types/pending_duty_status_durations_object_response_body.rb', line 23 def sleeper_berth_duration_ms @sleeper_berth_duration_ms end |
#waiting_time_duration_ms ⇒ Long (readonly)
Returns Duration the driver was waiting for in the log period in milliseconds.
25 26 27 |
# File 'lib/samsara_api/types/pending_duty_status_durations_object_response_body.rb', line 25 def waiting_time_duration_ms @waiting_time_duration_ms end |
#yard_move_duration_ms ⇒ Object (readonly)
milliseconds.
28 29 30 |
# File 'lib/samsara_api/types/pending_duty_status_durations_object_response_body.rb', line 28 def yard_move_duration_ms @yard_move_duration_ms end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::PendingDutyStatusDurationsObjectResponseBody
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/samsara_api/types/pending_duty_status_durations_object_response_body.rb', line 69 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) active_duration_ms = parsed_json["activeDurationMs"] drive_duration_ms = parsed_json["driveDurationMs"] off_duty_duration_ms = parsed_json["offDutyDurationMs"] on_duty_duration_ms = parsed_json["onDutyDurationMs"] personal_conveyance_duration_ms = parsed_json["personalConveyanceDurationMs"] sleeper_berth_duration_ms = parsed_json["sleeperBerthDurationMs"] waiting_time_duration_ms = parsed_json["waitingTimeDurationMs"] yard_move_duration_ms = parsed_json["yardMoveDurationMs"] new( active_duration_ms: active_duration_ms, drive_duration_ms: drive_duration_ms, off_duty_duration_ms: off_duty_duration_ms, on_duty_duration_ms: on_duty_duration_ms, personal_conveyance_duration_ms: personal_conveyance_duration_ms, sleeper_berth_duration_ms: sleeper_berth_duration_ms, waiting_time_duration_ms: waiting_time_duration_ms, yard_move_duration_ms: yard_move_duration_ms, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
105 106 107 108 109 110 111 112 113 114 |
# File 'lib/samsara_api/types/pending_duty_status_durations_object_response_body.rb', line 105 def self.validate_raw(obj:) obj.active_duration_ms&.is_a?(Long) != false || raise("Passed value for field obj.active_duration_ms is not the expected type, validation failed.") obj.drive_duration_ms&.is_a?(Long) != false || raise("Passed value for field obj.drive_duration_ms is not the expected type, validation failed.") obj.off_duty_duration_ms&.is_a?(Long) != false || raise("Passed value for field obj.off_duty_duration_ms is not the expected type, validation failed.") obj.on_duty_duration_ms&.is_a?(Long) != false || raise("Passed value for field obj.on_duty_duration_ms is not the expected type, validation failed.") obj.personal_conveyance_duration_ms&.is_a?(Long) != false || raise("Passed value for field obj.personal_conveyance_duration_ms is not the expected type, validation failed.") obj.sleeper_berth_duration_ms&.is_a?(Long) != false || raise("Passed value for field obj.sleeper_berth_duration_ms is not the expected type, validation failed.") obj.waiting_time_duration_ms&.is_a?(Long) != false || raise("Passed value for field obj.waiting_time_duration_ms is not the expected type, validation failed.") obj.yard_move_duration_ms&.is_a?(Long) != false || raise("Passed value for field obj.yard_move_duration_ms is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
96 97 98 |
# File 'lib/samsara_api/types/pending_duty_status_durations_object_response_body.rb', line 96 def to_json @_field_set&.to_json end |