Class: Samsara::Types::CoachAssignmentWithoutDriverExternalIdsResponseResponseBody
- Inherits:
-
Object
- Object
- Samsara::Types::CoachAssignmentWithoutDriverExternalIdsResponseResponseBody
- Defined in:
- lib/samsara_api/types/coach_assignment_without_driver_external_ids_response_response_body.rb
Overview
Driver coach assignment object.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#coach_id ⇒ Object
readonly
coach is assigned.
-
#created_at_time ⇒ DateTime
readonly
Time coach assignment was created in UTC.
-
#driver_id ⇒ String
readonly
Unique user ID for the driver of the driver coach assignment.
-
#updated_at_time ⇒ DateTime
readonly
Time coaching assignment was updated in UTC.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Samsara::Types::CoachAssignmentWithoutDriverExternalIdsResponseResponseBody
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(coach_id: OMIT, created_at_time:, driver_id:, updated_at_time:, additional_properties: nil) ⇒ Samsara::Types::CoachAssignmentWithoutDriverExternalIdsResponseResponseBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(coach_id: OMIT, created_at_time:, driver_id:, updated_at_time:, additional_properties: nil) ⇒ Samsara::Types::CoachAssignmentWithoutDriverExternalIdsResponseResponseBody
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/samsara_api/types/coach_assignment_without_driver_external_ids_response_response_body.rb', line 35 def initialize(coach_id: OMIT, created_at_time:, driver_id:, updated_at_time:, additional_properties: nil) @coach_id = coach_id if coach_id != OMIT @created_at_time = created_at_time @driver_id = driver_id @updated_at_time = updated_at_time @additional_properties = additional_properties @_field_set = { "coachId": coach_id, "createdAtTime": created_at_time, "driverId": driver_id, "updatedAtTime": updated_at_time }.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/coach_assignment_without_driver_external_ids_response_response_body.rb', line 21 def additional_properties @additional_properties end |
#coach_id ⇒ Object (readonly)
coach is assigned
13 14 15 |
# File 'lib/samsara_api/types/coach_assignment_without_driver_external_ids_response_response_body.rb', line 13 def coach_id @coach_id end |
#created_at_time ⇒ DateTime (readonly)
Returns Time coach assignment was created in UTC. Always returned.
15 16 17 |
# File 'lib/samsara_api/types/coach_assignment_without_driver_external_ids_response_response_body.rb', line 15 def created_at_time @created_at_time end |
#driver_id ⇒ String (readonly)
Returns Unique user ID for the driver of the driver coach assignment.
17 18 19 |
# File 'lib/samsara_api/types/coach_assignment_without_driver_external_ids_response_response_body.rb', line 17 def driver_id @driver_id end |
#updated_at_time ⇒ DateTime (readonly)
Returns Time coaching assignment was updated in UTC. Always returned.
19 20 21 |
# File 'lib/samsara_api/types/coach_assignment_without_driver_external_ids_response_response_body.rb', line 19 def updated_at_time @updated_at_time end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::CoachAssignmentWithoutDriverExternalIdsResponseResponseBody
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/samsara_api/types/coach_assignment_without_driver_external_ids_response_response_body.rb', line 50 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) coach_id = parsed_json["coachId"] created_at_time = unless parsed_json["createdAtTime"].nil? DateTime.parse(parsed_json["createdAtTime"]) else nil end driver_id = parsed_json["driverId"] updated_at_time = unless parsed_json["updatedAtTime"].nil? DateTime.parse(parsed_json["updatedAtTime"]) else nil end new( coach_id: coach_id, created_at_time: created_at_time, driver_id: driver_id, updated_at_time: updated_at_time, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
86 87 88 89 90 91 |
# File 'lib/samsara_api/types/coach_assignment_without_driver_external_ids_response_response_body.rb', line 86 def self.validate_raw(obj:) obj.coach_id&.is_a?(String) != false || raise("Passed value for field obj.coach_id is not the expected type, validation failed.") obj.created_at_time.is_a?(DateTime) != 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.updated_at_time.is_a?(DateTime) != false || raise("Passed value for field obj.updated_at_time is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
77 78 79 |
# File 'lib/samsara_api/types/coach_assignment_without_driver_external_ids_response_response_body.rb', line 77 def to_json @_field_set&.to_json end |