Class: Samsara::Types::PatchDriverTrailerAssignmentsResponseBodyResponseBody

Inherits:
Object
  • Object
show all
Defined in:
lib/samsara_api/types/patch_driver_trailer_assignments_response_body_response_body.rb

Overview

Response after successfully updating a Driver Trailer Assignment

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(created_at_time: OMIT, driver_id:, end_time:, id:, start_time:, trailer_id:, updated_at_time: OMIT, additional_properties: nil) ⇒ Samsara::Types::PatchDriverTrailerAssignmentsResponseBodyResponseBody

Parameters:

  • created_at_time (String) (defaults to: OMIT) —

    Time when the driver trailer assignment was created, in RFC 3339 format

  • driver_id (String) —

    Samsara ID for the driver that this assignment is for.

  • end_time (String) —

    Time when the driver trailer assignment ends, in RFC 3339 format

  • id (String) —

    Samsara ID for the assignment.

  • start_time (String) —

    Time when the driver trailer assignment starts, in RFC 3339 format

  • trailer_id (String) —

    Samsara ID of the trailer

  • updated_at_time (String) (defaults to: OMIT) —

    Time when the driver trailer assignment was last updated, in RFC 3339 format

  • additional_properties (OpenStruct) (defaults to: nil) —

    Additional properties unmapped to the current class definition



40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/samsara_api/types/patch_driver_trailer_assignments_response_body_response_body.rb', line 40

def initialize(created_at_time: OMIT, driver_id:, end_time:, id:, start_time:, trailer_id:, updated_at_time: OMIT, additional_properties: nil)
  @created_at_time = created_at_time if created_at_time != OMIT
  @driver_id = driver_id
  @end_time = end_time
  @id = id
  @start_time = start_time
  @trailer_id = trailer_id
  @updated_at_time = updated_at_time if updated_at_time != OMIT
  @additional_properties = additional_properties
  @_field_set = { "createdAtTime": created_at_time, "driverId": driver_id, "endTime": end_time, "id": id, "startTime": start_time, "trailerId": trailer_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.

Returns:

  • (OpenStruct) —

    Additional properties unmapped to the current class definition



24
25
26
# File 'lib/samsara_api/types/patch_driver_trailer_assignments_response_body_response_body.rb', line 24

def additional_properties
  @additional_properties
end

#created_at_time ⇒ String (readonly)

Returns Time when the driver trailer assignment was created, in RFC 3339 format.

Returns:

  • (String) —

    Time when the driver trailer assignment was created, in RFC 3339 format



10
11
12
# File 'lib/samsara_api/types/patch_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.

Returns:

  • (String) —

    Samsara ID for the driver that this assignment is for.



12
13
14
# File 'lib/samsara_api/types/patch_driver_trailer_assignments_response_body_response_body.rb', line 12

def driver_id
  @driver_id
end

#end_time ⇒ String (readonly)

Returns Time when the driver trailer assignment ends, in RFC 3339 format.

Returns:

  • (String) —

    Time when the driver trailer assignment ends, in RFC 3339 format



14
15
16
# File 'lib/samsara_api/types/patch_driver_trailer_assignments_response_body_response_body.rb', line 14

def end_time
  @end_time
end

#id ⇒ String (readonly)

Returns Samsara ID for the assignment.

Returns:

  • (String) —

    Samsara ID for the assignment.



16
17
18
# File 'lib/samsara_api/types/patch_driver_trailer_assignments_response_body_response_body.rb', line 16

def id
  @id
end

#start_time ⇒ String (readonly)

Returns Time when the driver trailer assignment starts, in RFC 3339 format.

Returns:

  • (String) —

    Time when the driver trailer assignment starts, in RFC 3339 format



18
19
20
# File 'lib/samsara_api/types/patch_driver_trailer_assignments_response_body_response_body.rb', line 18

def start_time
  @start_time
end

#trailer_id ⇒ String (readonly)

Returns Samsara ID of the trailer.

Returns:

  • (String) —

    Samsara ID of the trailer



20
21
22
# File 'lib/samsara_api/types/patch_driver_trailer_assignments_response_body_response_body.rb', line 20

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.

Returns:

  • (String) —

    Time when the driver trailer assignment was last updated, in RFC 3339 format



22
23
24
# File 'lib/samsara_api/types/patch_driver_trailer_assignments_response_body_response_body.rb', line 22

def updated_at_time
  @updated_at_time
end

Class Method Details

.from_json(json_object:) ⇒ Samsara::Types::PatchDriverTrailerAssignmentsResponseBodyResponseBody

Parameters:

  • json_object (String)

Returns:



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/samsara_api/types/patch_driver_trailer_assignments_response_body_response_body.rb', line 58

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"]
  end_time = parsed_json["endTime"]
  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,
    end_time: end_time,
    id: id,
    start_time: start_time,
    trailer_id: trailer_id,
    updated_at_time: updated_at_time,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


92
93
94
95
96
97
98
99
100
# File 'lib/samsara_api/types/patch_driver_trailer_assignments_response_body_response_body.rb', line 92

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.end_time.is_a?(String) != false || raise("Passed value for field obj.end_time 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

Returns:

  • (String)


83
84
85
# File 'lib/samsara_api/types/patch_driver_trailer_assignments_response_body_response_body.rb', line 83

def to_json
  @_field_set&.to_json
end