Class: Samsara::Types::LogMetaDataObjectResponseBody
- Inherits:
-
Object
- Object
- Samsara::Types::LogMetaDataObjectResponseBody
- Defined in:
- lib/samsara_api/types/log_meta_data_object_response_body.rb
Overview
The metadata of the log.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#adverse_driving_claimed ⇒ Object
readonly
for this HOS day chart.
-
#big_day_claimed ⇒ Object
readonly
for this HOS day chart.
-
#carrier_formatted_address ⇒ String
readonly
The address of the carrier used for this HOS chart.
-
#carrier_name ⇒ String
readonly
The name of the carrier used for this HOS chart.
-
#carrier_us_dot_number ⇒ Long
readonly
The US DOT number of the carrier used for this HOS chart.
-
#certified_at_time ⇒ String
readonly
The time this log was certified in RFC 3339 format.
-
#home_terminal_formatted_address ⇒ String
readonly
The address of the Home Terminal used for this HOS chart.
-
#home_terminal_name ⇒ String
readonly
The name of the Home Terminal used for this HOS chart.
-
#is_certified ⇒ Boolean
readonly
Whether this HOS day chart was certified by the driver.
-
#is_us_short_haul_active ⇒ Object
readonly
day chart.
-
#shipping_docs ⇒ Object
readonly
field maps to Shipping ID in the dashboard.
-
#trailer_names ⇒ Object
readonly
trailer ID.
-
#vehicles ⇒ Array<Samsara::Types::VehicleResponseResponseBody>
readonly
List of vehicles associated with the driver for the day.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(adverse_driving_claimed: OMIT, big_day_claimed: OMIT, carrier_formatted_address: OMIT, carrier_name: OMIT, carrier_us_dot_number: OMIT, certified_at_time: OMIT, home_terminal_formatted_address: OMIT, home_terminal_name: OMIT, is_certified: OMIT, is_us_short_haul_active: OMIT, shipping_docs: OMIT, trailer_names: OMIT, vehicles: OMIT, additional_properties: nil) ⇒ Samsara::Types::LogMetaDataObjectResponseBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(adverse_driving_claimed: OMIT, big_day_claimed: OMIT, carrier_formatted_address: OMIT, carrier_name: OMIT, carrier_us_dot_number: OMIT, certified_at_time: OMIT, home_terminal_formatted_address: OMIT, home_terminal_name: OMIT, is_certified: OMIT, is_us_short_haul_active: OMIT, shipping_docs: OMIT, trailer_names: OMIT, vehicles: OMIT, additional_properties: nil) ⇒ Samsara::Types::LogMetaDataObjectResponseBody
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/samsara_api/types/log_meta_data_object_response_body.rb', line 75 def initialize(adverse_driving_claimed: OMIT, big_day_claimed: OMIT, carrier_formatted_address: OMIT, carrier_name: OMIT, carrier_us_dot_number: OMIT, certified_at_time: OMIT, home_terminal_formatted_address: OMIT, home_terminal_name: OMIT, is_certified: OMIT, is_us_short_haul_active: OMIT, shipping_docs: OMIT, trailer_names: OMIT, vehicles: OMIT, additional_properties: nil) @adverse_driving_claimed = adverse_driving_claimed if adverse_driving_claimed != OMIT @big_day_claimed = big_day_claimed if big_day_claimed != OMIT @carrier_formatted_address = carrier_formatted_address if carrier_formatted_address != OMIT @carrier_name = carrier_name if carrier_name != OMIT @carrier_us_dot_number = carrier_us_dot_number if carrier_us_dot_number != OMIT @certified_at_time = certified_at_time if certified_at_time != OMIT @home_terminal_formatted_address = home_terminal_formatted_address if home_terminal_formatted_address != OMIT @home_terminal_name = home_terminal_name if home_terminal_name != OMIT @is_certified = is_certified if is_certified != OMIT @is_us_short_haul_active = is_us_short_haul_active if is_us_short_haul_active != OMIT @shipping_docs = shipping_docs if shipping_docs != OMIT @trailer_names = trailer_names if trailer_names != OMIT @vehicles = vehicles if vehicles != OMIT @additional_properties = additional_properties @_field_set = { "adverseDrivingClaimed": adverse_driving_claimed, "bigDayClaimed": big_day_claimed, "carrierFormattedAddress": carrier_formatted_address, "carrierName": carrier_name, "carrierUsDotNumber": carrier_us_dot_number, "certifiedAtTime": certified_at_time, "homeTerminalFormattedAddress": home_terminal_formatted_address, "homeTerminalName": home_terminal_name, "isCertified": is_certified, "isUsShortHaulActive": is_us_short_haul_active, "shippingDocs": shipping_docs, "trailerNames": trailer_names, "vehicles": vehicles }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
45 46 47 |
# File 'lib/samsara_api/types/log_meta_data_object_response_body.rb', line 45 def additional_properties @additional_properties end |
#adverse_driving_claimed ⇒ Object (readonly)
for this HOS day chart.
13 14 15 |
# File 'lib/samsara_api/types/log_meta_data_object_response_body.rb', line 13 def adverse_driving_claimed @adverse_driving_claimed end |
#big_day_claimed ⇒ Object (readonly)
for this HOS day chart.
17 18 19 |
# File 'lib/samsara_api/types/log_meta_data_object_response_body.rb', line 17 def big_day_claimed @big_day_claimed end |
#carrier_formatted_address ⇒ String (readonly)
Returns The address of the carrier used for this HOS chart.
19 20 21 |
# File 'lib/samsara_api/types/log_meta_data_object_response_body.rb', line 19 def carrier_formatted_address @carrier_formatted_address end |
#carrier_name ⇒ String (readonly)
Returns The name of the carrier used for this HOS chart.
21 22 23 |
# File 'lib/samsara_api/types/log_meta_data_object_response_body.rb', line 21 def carrier_name @carrier_name end |
#carrier_us_dot_number ⇒ Long (readonly)
Returns The US DOT number of the carrier used for this HOS chart.
23 24 25 |
# File 'lib/samsara_api/types/log_meta_data_object_response_body.rb', line 23 def carrier_us_dot_number @carrier_us_dot_number end |
#certified_at_time ⇒ String (readonly)
Returns The time this log was certified in RFC 3339 format.
25 26 27 |
# File 'lib/samsara_api/types/log_meta_data_object_response_body.rb', line 25 def certified_at_time @certified_at_time end |
#home_terminal_formatted_address ⇒ String (readonly)
Returns The address of the Home Terminal used for this HOS chart.
27 28 29 |
# File 'lib/samsara_api/types/log_meta_data_object_response_body.rb', line 27 def home_terminal_formatted_address @home_terminal_formatted_address end |
#home_terminal_name ⇒ String (readonly)
Returns The name of the Home Terminal used for this HOS chart.
29 30 31 |
# File 'lib/samsara_api/types/log_meta_data_object_response_body.rb', line 29 def home_terminal_name @home_terminal_name end |
#is_certified ⇒ Boolean (readonly)
Returns Whether this HOS day chart was certified by the driver.
31 32 33 |
# File 'lib/samsara_api/types/log_meta_data_object_response_body.rb', line 31 def is_certified @is_certified end |
#is_us_short_haul_active ⇒ Object (readonly)
day chart.
34 35 36 |
# File 'lib/samsara_api/types/log_meta_data_object_response_body.rb', line 34 def is_us_short_haul_active @is_us_short_haul_active end |
#shipping_docs ⇒ Object (readonly)
field maps to Shipping ID in the dashboard.
37 38 39 |
# File 'lib/samsara_api/types/log_meta_data_object_response_body.rb', line 37 def shipping_docs @shipping_docs end |
#trailer_names ⇒ Object (readonly)
trailer ID.
41 42 43 |
# File 'lib/samsara_api/types/log_meta_data_object_response_body.rb', line 41 def trailer_names @trailer_names end |
#vehicles ⇒ Array<Samsara::Types::VehicleResponseResponseBody> (readonly)
Returns List of vehicles associated with the driver for the day.
43 44 45 |
# File 'lib/samsara_api/types/log_meta_data_object_response_body.rb', line 43 def vehicles @vehicles end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::LogMetaDataObjectResponseBody
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
# File 'lib/samsara_api/types/log_meta_data_object_response_body.rb', line 98 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) adverse_driving_claimed = parsed_json["adverseDrivingClaimed"] big_day_claimed = parsed_json["bigDayClaimed"] carrier_formatted_address = parsed_json["carrierFormattedAddress"] carrier_name = parsed_json["carrierName"] carrier_us_dot_number = parsed_json["carrierUsDotNumber"] certified_at_time = parsed_json["certifiedAtTime"] home_terminal_formatted_address = parsed_json["homeTerminalFormattedAddress"] home_terminal_name = parsed_json["homeTerminalName"] is_certified = parsed_json["isCertified"] is_us_short_haul_active = parsed_json["isUsShortHaulActive"] shipping_docs = parsed_json["shippingDocs"] trailer_names = parsed_json["trailerNames"] vehicles = parsed_json["vehicles"]&.map do | item | item = item.to_json Samsara::Types::VehicleResponseResponseBody.from_json(json_object: item) end new( adverse_driving_claimed: adverse_driving_claimed, big_day_claimed: big_day_claimed, carrier_formatted_address: carrier_formatted_address, carrier_name: carrier_name, carrier_us_dot_number: carrier_us_dot_number, certified_at_time: certified_at_time, home_terminal_formatted_address: home_terminal_formatted_address, home_terminal_name: home_terminal_name, is_certified: is_certified, is_us_short_haul_active: is_us_short_haul_active, shipping_docs: shipping_docs, trailer_names: trailer_names, vehicles: vehicles, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/samsara_api/types/log_meta_data_object_response_body.rb', line 146 def self.validate_raw(obj:) obj.adverse_driving_claimed&.is_a?(Boolean) != false || raise("Passed value for field obj.adverse_driving_claimed is not the expected type, validation failed.") obj.big_day_claimed&.is_a?(Boolean) != false || raise("Passed value for field obj.big_day_claimed is not the expected type, validation failed.") obj.carrier_formatted_address&.is_a?(String) != false || raise("Passed value for field obj.carrier_formatted_address is not the expected type, validation failed.") obj.carrier_name&.is_a?(String) != false || raise("Passed value for field obj.carrier_name is not the expected type, validation failed.") obj.carrier_us_dot_number&.is_a?(Long) != false || raise("Passed value for field obj.carrier_us_dot_number is not the expected type, validation failed.") obj.certified_at_time&.is_a?(String) != false || raise("Passed value for field obj.certified_at_time is not the expected type, validation failed.") obj.home_terminal_formatted_address&.is_a?(String) != false || raise("Passed value for field obj.home_terminal_formatted_address is not the expected type, validation failed.") obj.home_terminal_name&.is_a?(String) != false || raise("Passed value for field obj.home_terminal_name is not the expected type, validation failed.") obj.is_certified&.is_a?(Boolean) != false || raise("Passed value for field obj.is_certified is not the expected type, validation failed.") obj.is_us_short_haul_active&.is_a?(Boolean) != false || raise("Passed value for field obj.is_us_short_haul_active is not the expected type, validation failed.") obj.shipping_docs&.is_a?(String) != false || raise("Passed value for field obj.shipping_docs is not the expected type, validation failed.") obj.trailer_names&.is_a?(Array) != false || raise("Passed value for field obj.trailer_names is not the expected type, validation failed.") obj.vehicles&.is_a?(Array) != false || raise("Passed value for field obj.vehicles is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
137 138 139 |
# File 'lib/samsara_api/types/log_meta_data_object_response_body.rb', line 137 def to_json @_field_set&.to_json end |