Class: Samsara::Types::PostDriverTrailerAssignmentsResponseBodyResponseBody
- Inherits:
-
Object
- Object
- Samsara::Types::PostDriverTrailerAssignmentsResponseBodyResponseBody
- Defined in:
- lib/samsara_api/types/post_driver_trailer_assignments_response_body_response_body.rb
Overview
Response after successfully submitting a Driver Trailer Assignment
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#created_at_time ⇒ String
readonly
Time when the driver trailer assignment was created, in RFC 3339 format.
-
#driver_id ⇒ String
readonly
Samsara ID for the driver that this assignment is for.
-
#id ⇒ String
readonly
Samsara ID for the assignment.
-
#start_time ⇒ String
readonly
Time when the driver trailer assignment starts, in RFC 3339 format.
-
#trailer_id ⇒ String
readonly
Samsara ID of the trailer.
-
#updated_at_time ⇒ String
readonly
Time when the driver trailer assignment was last updated, in RFC 3339 format.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Samsara::Types::PostDriverTrailerAssignmentsResponseBodyResponseBody
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(created_at_time:, driver_id:, id:, start_time:, trailer_id:, updated_at_time:, additional_properties: nil) ⇒ Samsara::Types::PostDriverTrailerAssignmentsResponseBodyResponseBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(created_at_time:, driver_id:, id:, start_time:, trailer_id:, updated_at_time:, additional_properties: nil) ⇒ Samsara::Types::PostDriverTrailerAssignmentsResponseBodyResponseBody
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/samsara_api/types/post_driver_trailer_assignments_response_body_response_body.rb', line 37 def initialize(created_at_time:, driver_id:, id:, start_time:, trailer_id:, updated_at_time:, additional_properties: nil) @created_at_time = created_at_time @driver_id = driver_id @id = id @start_time = start_time @trailer_id = trailer_id @updated_at_time = updated_at_time @additional_properties = additional_properties @_field_set = { "createdAtTime": created_at_time, "driverId": driver_id, "id": id, "startTime": start_time, "trailerId": trailer_id, "updatedAtTime": updated_at_time } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
22 23 24 |
# File 'lib/samsara_api/types/post_driver_trailer_assignments_response_body_response_body.rb', line 22 def additional_properties @additional_properties end |
#created_at_time ⇒ String (readonly)
Returns Time when the driver trailer assignment was created, in RFC 3339 format.
10 11 12 |
# File 'lib/samsara_api/types/post_driver_trailer_assignments_response_body_response_body.rb', line 10 def created_at_time @created_at_time end |
#driver_id ⇒ String (readonly)
Returns Samsara ID for the driver that this assignment is for.
12 13 14 |
# File 'lib/samsara_api/types/post_driver_trailer_assignments_response_body_response_body.rb', line 12 def driver_id @driver_id end |
#id ⇒ String (readonly)
Returns Samsara ID for the assignment.
14 15 16 |
# File 'lib/samsara_api/types/post_driver_trailer_assignments_response_body_response_body.rb', line 14 def id @id end |
#start_time ⇒ String (readonly)
Returns Time when the driver trailer assignment starts, in RFC 3339 format.
16 17 18 |
# File 'lib/samsara_api/types/post_driver_trailer_assignments_response_body_response_body.rb', line 16 def start_time @start_time end |
#trailer_id ⇒ String (readonly)
Returns Samsara ID of the trailer.
18 19 20 |
# File 'lib/samsara_api/types/post_driver_trailer_assignments_response_body_response_body.rb', line 18 def trailer_id @trailer_id end |
#updated_at_time ⇒ String (readonly)
Returns Time when the driver trailer assignment was last updated, in RFC 3339 format.
20 21 22 |
# File 'lib/samsara_api/types/post_driver_trailer_assignments_response_body_response_body.rb', line 20 def updated_at_time @updated_at_time end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::PostDriverTrailerAssignmentsResponseBodyResponseBody
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/samsara_api/types/post_driver_trailer_assignments_response_body_response_body.rb', line 52 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) created_at_time = parsed_json["createdAtTime"] driver_id = parsed_json["driverId"] id = parsed_json["id"] start_time = parsed_json["startTime"] trailer_id = parsed_json["trailerId"] updated_at_time = parsed_json["updatedAtTime"] new( created_at_time: created_at_time, driver_id: driver_id, id: id, start_time: start_time, trailer_id: trailer_id, updated_at_time: updated_at_time, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
84 85 86 87 88 89 90 91 |
# File 'lib/samsara_api/types/post_driver_trailer_assignments_response_body_response_body.rb', line 84 def self.validate_raw(obj:) obj.created_at_time.is_a?(String) != false || raise("Passed value for field obj.created_at_time is not the expected type, validation failed.") obj.driver_id.is_a?(String) != false || raise("Passed value for field obj.driver_id is not the expected type, validation failed.") obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.") obj.start_time.is_a?(String) != false || raise("Passed value for field obj.start_time is not the expected type, validation failed.") obj.trailer_id.is_a?(String) != false || raise("Passed value for field obj.trailer_id is not the expected type, validation failed.") obj.updated_at_time.is_a?(String) != false || raise("Passed value for field obj.updated_at_time is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
75 76 77 |
# File 'lib/samsara_api/types/post_driver_trailer_assignments_response_body_response_body.rb', line 75 def to_json @_field_set&.to_json end |