Class: Samsara::Types::TrailerAssignmentsGetDriverTrailerAssignmentsResponseBody
- Inherits:
-
Object
- Object
- Samsara::Types::TrailerAssignmentsGetDriverTrailerAssignmentsResponseBody
- Defined in:
- lib/samsara_api/types/trailer_assignments_get_driver_trailer_assignments_response_body.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#data ⇒ Object
readonly
trailer info.
- #pagination ⇒ Samsara::Types::GoaPaginationResponseResponseBody readonly
Class Method Summary collapse
- .from_json(json_object:) ⇒ Samsara::Types::TrailerAssignmentsGetDriverTrailerAssignmentsResponseBody
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(data:, pagination:, additional_properties: nil) ⇒ Samsara::Types::TrailerAssignmentsGetDriverTrailerAssignmentsResponseBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(data:, pagination:, additional_properties: nil) ⇒ Samsara::Types::TrailerAssignmentsGetDriverTrailerAssignmentsResponseBody
28 29 30 31 32 33 |
# File 'lib/samsara_api/types/trailer_assignments_get_driver_trailer_assignments_response_body.rb', line 28 def initialize(data:, pagination:, additional_properties: nil) @data = data @pagination = pagination @additional_properties = additional_properties @_field_set = { "data": data, "pagination": pagination } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
16 17 18 |
# File 'lib/samsara_api/types/trailer_assignments_get_driver_trailer_assignments_response_body.rb', line 16 def additional_properties @additional_properties end |
#data ⇒ Object (readonly)
trailer info.
12 13 14 |
# File 'lib/samsara_api/types/trailer_assignments_get_driver_trailer_assignments_response_body.rb', line 12 def data @data end |
#pagination ⇒ Samsara::Types::GoaPaginationResponseResponseBody (readonly)
14 15 16 |
# File 'lib/samsara_api/types/trailer_assignments_get_driver_trailer_assignments_response_body.rb', line 14 def pagination @pagination end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::TrailerAssignmentsGetDriverTrailerAssignmentsResponseBody
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/samsara_api/types/trailer_assignments_get_driver_trailer_assignments_response_body.rb', line 39 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) data = parsed_json["data"]&.map do | item | item = item.to_json Samsara::Types::GetDriverTrailerAssignmentsResponseBodyResponseBody.from_json(json_object: item) end unless parsed_json["pagination"].nil? pagination = parsed_json["pagination"].to_json pagination = Samsara::Types::GoaPaginationResponseResponseBody.from_json(json_object: pagination) else pagination = nil end new( data: data, pagination: pagination, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
71 72 73 74 |
# File 'lib/samsara_api/types/trailer_assignments_get_driver_trailer_assignments_response_body.rb', line 71 def self.validate_raw(obj:) obj.data.is_a?(Array) != false || raise("Passed value for field obj.data is not the expected type, validation failed.") Samsara::Types::GoaPaginationResponseResponseBody.validate_raw(obj: obj.pagination) end |
Instance Method Details
#to_json ⇒ String
62 63 64 |
# File 'lib/samsara_api/types/trailer_assignments_get_driver_trailer_assignments_response_body.rb', line 62 def to_json @_field_set&.to_json end |