Class: Samsara::Types::VehicleResponseObjectResponseBody

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

Overview

A single vehicle

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes: OMIT, aux_input_type_1: OMIT, aux_input_type_10: OMIT, aux_input_type_11: OMIT, aux_input_type_12: OMIT, aux_input_type_13: OMIT, aux_input_type_2: OMIT, aux_input_type_3: OMIT, aux_input_type_4: OMIT, aux_input_type_5: OMIT, aux_input_type_6: OMIT, aux_input_type_7: OMIT, aux_input_type_8: OMIT, aux_input_type_9: OMIT, camera_serial: OMIT, created_at_time:, esn: OMIT, external_ids: OMIT, gateway: OMIT, harsh_acceleration_setting_type: OMIT, id:, license_plate: OMIT, make: OMIT, model: OMIT, name: OMIT, notes: OMIT, sensor_configuration: OMIT, serial: OMIT, static_assigned_driver: OMIT, tags: OMIT, updated_at_time: OMIT, vehicle_regulation_mode: OMIT, vehicle_type: OMIT, vehicle_weight: OMIT, vehicle_weight_in_kilograms: OMIT, vehicle_weight_in_pounds: OMIT, vin: OMIT, year: OMIT, additional_properties: nil) ⇒ Samsara::Types::VehicleResponseObjectResponseBody

Parameters:

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

    The VIN of the vehicle.

  • year (String) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil) —

    Additional properties unmapped to the current class definition



154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 154

def initialize(attributes: OMIT, aux_input_type_1: OMIT, aux_input_type_10: OMIT, aux_input_type_11: OMIT, aux_input_type_12: OMIT, aux_input_type_13: OMIT, aux_input_type_2: OMIT, aux_input_type_3: OMIT, aux_input_type_4: OMIT, aux_input_type_5: OMIT, aux_input_type_6: OMIT, aux_input_type_7: OMIT, aux_input_type_8: OMIT, aux_input_type_9: OMIT, camera_serial: OMIT, created_at_time:, esn: OMIT, external_ids: OMIT, gateway: OMIT, harsh_acceleration_setting_type: OMIT, id:, license_plate: OMIT, make: OMIT, model: OMIT, name: OMIT, notes: OMIT, sensor_configuration: OMIT, serial: OMIT, static_assigned_driver: OMIT, tags: OMIT, updated_at_time: OMIT, vehicle_regulation_mode: OMIT, vehicle_type: OMIT, vehicle_weight: OMIT, vehicle_weight_in_kilograms: OMIT, vehicle_weight_in_pounds: OMIT, vin: OMIT, year: OMIT, additional_properties: nil)
  @attributes = attributes if attributes != OMIT
  @aux_input_type_1 = aux_input_type_1 if aux_input_type_1 != OMIT
  @aux_input_type_10 = aux_input_type_10 if aux_input_type_10 != OMIT
  @aux_input_type_11 = aux_input_type_11 if aux_input_type_11 != OMIT
  @aux_input_type_12 = aux_input_type_12 if aux_input_type_12 != OMIT
  @aux_input_type_13 = aux_input_type_13 if aux_input_type_13 != OMIT
  @aux_input_type_2 = aux_input_type_2 if aux_input_type_2 != OMIT
  @aux_input_type_3 = aux_input_type_3 if aux_input_type_3 != OMIT
  @aux_input_type_4 = aux_input_type_4 if aux_input_type_4 != OMIT
  @aux_input_type_5 = aux_input_type_5 if aux_input_type_5 != OMIT
  @aux_input_type_6 = aux_input_type_6 if aux_input_type_6 != OMIT
  @aux_input_type_7 = aux_input_type_7 if aux_input_type_7 != OMIT
  @aux_input_type_8 = aux_input_type_8 if aux_input_type_8 != OMIT
  @aux_input_type_9 = aux_input_type_9 if aux_input_type_9 != OMIT
  @camera_serial = camera_serial if camera_serial != OMIT
  @created_at_time = created_at_time
  @esn = esn if esn != OMIT
  @external_ids = external_ids if external_ids != OMIT
  @gateway = gateway if gateway != OMIT
  @harsh_acceleration_setting_type = harsh_acceleration_setting_type if harsh_acceleration_setting_type != OMIT
  @id = id
  @license_plate = license_plate if license_plate != OMIT
  @make = make if make != OMIT
  @model = model if model != OMIT
  @name = name if name != OMIT
  @notes = notes if notes != OMIT
  @sensor_configuration = sensor_configuration if sensor_configuration != OMIT
  @serial = serial if serial != OMIT
  @static_assigned_driver = static_assigned_driver if static_assigned_driver != OMIT
  @tags = tags if tags != OMIT
  @updated_at_time = updated_at_time if updated_at_time != OMIT
  @vehicle_regulation_mode = vehicle_regulation_mode if vehicle_regulation_mode != OMIT
  @vehicle_type = vehicle_type if vehicle_type != OMIT
  @vehicle_weight = vehicle_weight if vehicle_weight != OMIT
  @vehicle_weight_in_kilograms = vehicle_weight_in_kilograms if vehicle_weight_in_kilograms != OMIT
  @vehicle_weight_in_pounds = vehicle_weight_in_pounds if vehicle_weight_in_pounds != OMIT
  @vin = vin if vin != OMIT
  @year = year if year != OMIT
  @additional_properties = additional_properties
  @_field_set = { "attributes": attributes, "auxInputType1": aux_input_type_1, "auxInputType10": aux_input_type_10, "auxInputType11": aux_input_type_11, "auxInputType12": aux_input_type_12, "auxInputType13": aux_input_type_13, "auxInputType2": aux_input_type_2, "auxInputType3": aux_input_type_3, "auxInputType4": aux_input_type_4, "auxInputType5": aux_input_type_5, "auxInputType6": aux_input_type_6, "auxInputType7": aux_input_type_7, "auxInputType8": aux_input_type_8, "auxInputType9": aux_input_type_9, "cameraSerial": camera_serial, "createdAtTime": created_at_time, "esn": esn, "externalIds": external_ids, "gateway": gateway, "harshAccelerationSettingType": harsh_acceleration_setting_type, "id": id, "licensePlate": license_plate, "make": make, "model": model, "name": name, "notes": notes, "sensorConfiguration": sensor_configuration, "serial": serial, "staticAssignedDriver": static_assigned_driver, "tags": tags, "updatedAtTime": updated_at_time, "vehicleRegulationMode": vehicle_regulation_mode, "vehicleType": vehicle_type, "vehicleWeight": vehicle_weight, "vehicleWeightInKilograms": vehicle_weight_in_kilograms, "vehicleWeightInPounds": vehicle_weight_in_pounds, "vin": vin, "year": year }.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



101
102
103
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 101

def additional_properties
  @additional_properties
end

#attributes ⇒ Array<Samsara::Types::GoaAttributeTinyResponseBody> (readonly)

Returns List of attributes associated with the entity.

Returns:



19
20
21
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 19

def attributes
  @attributes
end

#aux_input_type_1 ⇒ String (readonly)

Returns The type of auxiliary input configured for this Vehicle.

Returns:

  • (String) —

    The type of auxiliary input configured for this Vehicle.



21
22
23
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 21

def aux_input_type_1
  @aux_input_type_1
end

#aux_input_type_10 ⇒ String (readonly)

Returns The type of auxiliary input configured for this Vehicle.

Returns:

  • (String) —

    The type of auxiliary input configured for this Vehicle.



23
24
25
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 23

def aux_input_type_10
  @aux_input_type_10
end

#aux_input_type_11 ⇒ String (readonly)

Returns The type of auxiliary input configured for this Vehicle.

Returns:

  • (String) —

    The type of auxiliary input configured for this Vehicle.



25
26
27
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 25

def aux_input_type_11
  @aux_input_type_11
end

#aux_input_type_12 ⇒ String (readonly)

Returns The type of auxiliary input configured for this Vehicle.

Returns:

  • (String) —

    The type of auxiliary input configured for this Vehicle.



27
28
29
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 27

def aux_input_type_12
  @aux_input_type_12
end

#aux_input_type_13 ⇒ String (readonly)

Returns The type of auxiliary input configured for this Vehicle.

Returns:

  • (String) —

    The type of auxiliary input configured for this Vehicle.



29
30
31
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 29

def aux_input_type_13
  @aux_input_type_13
end

#aux_input_type_2 ⇒ String (readonly)

Returns The type of auxiliary input configured for this Vehicle.

Returns:

  • (String) —

    The type of auxiliary input configured for this Vehicle.



31
32
33
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 31

def aux_input_type_2
  @aux_input_type_2
end

#aux_input_type_3 ⇒ String (readonly)

Returns The type of auxiliary input configured for this Vehicle.

Returns:

  • (String) —

    The type of auxiliary input configured for this Vehicle.



33
34
35
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 33

def aux_input_type_3
  @aux_input_type_3
end

#aux_input_type_4 ⇒ String (readonly)

Returns The type of auxiliary input configured for this Vehicle.

Returns:

  • (String) —

    The type of auxiliary input configured for this Vehicle.



35
36
37
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 35

def aux_input_type_4
  @aux_input_type_4
end

#aux_input_type_5 ⇒ String (readonly)

Returns The type of auxiliary input configured for this Vehicle.

Returns:

  • (String) —

    The type of auxiliary input configured for this Vehicle.



37
38
39
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 37

def aux_input_type_5
  @aux_input_type_5
end

#aux_input_type_6 ⇒ String (readonly)

Returns The type of auxiliary input configured for this Vehicle.

Returns:

  • (String) —

    The type of auxiliary input configured for this Vehicle.



39
40
41
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 39

def aux_input_type_6
  @aux_input_type_6
end

#aux_input_type_7 ⇒ String (readonly)

Returns The type of auxiliary input configured for this Vehicle.

Returns:

  • (String) —

    The type of auxiliary input configured for this Vehicle.



41
42
43
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 41

def aux_input_type_7
  @aux_input_type_7
end

#aux_input_type_8 ⇒ String (readonly)

Returns The type of auxiliary input configured for this Vehicle.

Returns:

  • (String) —

    The type of auxiliary input configured for this Vehicle.



43
44
45
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 43

def aux_input_type_8
  @aux_input_type_8
end

#aux_input_type_9 ⇒ String (readonly)

Returns The type of auxiliary input configured for this Vehicle.

Returns:

  • (String) —

    The type of auxiliary input configured for this Vehicle.



45
46
47
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 45

def aux_input_type_9
  @aux_input_type_9
end

#camera_serial ⇒ String (readonly)

Returns The serial number of the camera installed in the vehicle.

Returns:

  • (String) —

    The serial number of the camera installed in the vehicle



47
48
49
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 47

def camera_serial
  @camera_serial
end

#created_at_time ⇒ DateTime (readonly)

Returns Time the vehicle was created in RFC 3339 format.

Returns:

  • (DateTime) —

    Time the vehicle was created in RFC 3339 format.



49
50
51
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 49

def created_at_time
  @created_at_time
end

#esn ⇒ String (readonly)

Returns Engine serial number.

Returns:

  • (String) —

    Engine serial number.



51
52
53
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 51

def esn
  @esn
end

#external_ids ⇒ Hash{String => String} (readonly)

Returns A map of external ids.

Returns:

  • (Hash{String => String}) —

    A map of external ids



53
54
55
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 53

def external_ids
  @external_ids
end

#gateway ⇒ Samsara::Types::GoaGatewayTinyResponseResponseBody (readonly)



55
56
57
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 55

def gateway
  @gateway
end

#harsh_acceleration_setting_type ⇒ String (readonly)

Returns The harsh acceleration setting type.

Returns:

  • (String) —

    The harsh acceleration setting type.



57
58
59
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 57

def harsh_acceleration_setting_type
  @harsh_acceleration_setting_type
end

#id ⇒ String (readonly)

Returns ID of the vehicle.

Returns:

  • (String) —

    ID of the vehicle



59
60
61
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 59

def id
  @id
end

#license_plate ⇒ String (readonly)

Returns The license plate of the vehicle.

Returns:

  • (String) —

    The license plate of the vehicle.



61
62
63
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 61

def license_plate
  @license_plate
end

#make ⇒ String (readonly)

Returns The Vehicle’s manufacturing make.

Returns:

  • (String) —

    The Vehicle’s manufacturing make.



63
64
65
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 63

def make
  @make
end

#model ⇒ String (readonly)

Returns The Vehicle’s manufacturing model.

Returns:

  • (String) —

    The Vehicle’s manufacturing model.



65
66
67
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 65

def model
  @model
end

#name ⇒ String (readonly)

Returns Name of the vehicle.

Returns:

  • (String) —

    Name of the vehicle



67
68
69
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 67

def name
  @name
end

#notes ⇒ String (readonly)

Returns These are generic notes about the Vehicle.

Returns:

  • (String) —

    These are generic notes about the Vehicle.



69
70
71
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 69

def notes
  @notes
end

#sensor_configuration ⇒ Samsara::Types::VehicleSensorConfigurationResponseBody (readonly)



71
72
73
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 71

def sensor_configuration
  @sensor_configuration
end

#serial ⇒ String (readonly)

Returns The serial number of the gateway installed in the vehicle.

Returns:

  • (String) —

    The serial number of the gateway installed in the vehicle.



73
74
75
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 73

def serial
  @serial
end

#static_assigned_driver ⇒ Samsara::Types::DriverObjectResponseBody (readonly)



75
76
77
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 75

def static_assigned_driver
  @static_assigned_driver
end

#tags ⇒ Array<Samsara::Types::GoaTagTinyResponseResponseBody> (readonly)

Returns The list of tags associated with the Vehicle.

Returns:



77
78
79
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 77

def tags
  @tags
end

#updated_at_time ⇒ DateTime (readonly)

Returns Time the vehicle was updated in RFC 3339 format.

Returns:

  • (DateTime) —

    Time the vehicle was updated in RFC 3339 format.



79
80
81
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 79

def updated_at_time
  @updated_at_time
end

#vehicle_regulation_mode ⇒ Object (readonly)

regulated, unregulated



82
83
84
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 82

def vehicle_regulation_mode
  @vehicle_regulation_mode
end

#vehicle_type ⇒ Object (readonly)

limits (CSL) enabled. Valid values: unset, passenger, truck, bus



85
86
87
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 85

def vehicle_type
  @vehicle_type
end

#vehicle_weight ⇒ Object (readonly)

(CSL) enabled.



89
90
91
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 89

def vehicle_weight
  @vehicle_weight
end

#vehicle_weight_in_kilograms ⇒ Object (readonly)

commercial speed limits (CSL) enabled.



92
93
94
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 92

def vehicle_weight_in_kilograms
  @vehicle_weight_in_kilograms
end

#vehicle_weight_in_pounds ⇒ Object (readonly)

commercial speed limits (CSL) enabled.



95
96
97
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 95

def vehicle_weight_in_pounds
  @vehicle_weight_in_pounds
end

#vin ⇒ String (readonly)

Returns The VIN of the vehicle.

Returns:

  • (String) —

    The VIN of the vehicle.



97
98
99
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 97

def vin
  @vin
end

#year ⇒ String (readonly)

Returns:

  • (String)


99
100
101
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 99

def year
  @year
end

Class Method Details

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

Parameters:

  • json_object (String)

Returns:



202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 202

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  attributes = parsed_json["attributes"]&.map do | item |
  item = item.to_json
  Samsara::Types::GoaAttributeTinyResponseBody.from_json(json_object: item)
end
  aux_input_type_1 = parsed_json["auxInputType1"]
  aux_input_type_10 = parsed_json["auxInputType10"]
  aux_input_type_11 = parsed_json["auxInputType11"]
  aux_input_type_12 = parsed_json["auxInputType12"]
  aux_input_type_13 = parsed_json["auxInputType13"]
  aux_input_type_2 = parsed_json["auxInputType2"]
  aux_input_type_3 = parsed_json["auxInputType3"]
  aux_input_type_4 = parsed_json["auxInputType4"]
  aux_input_type_5 = parsed_json["auxInputType5"]
  aux_input_type_6 = parsed_json["auxInputType6"]
  aux_input_type_7 = parsed_json["auxInputType7"]
  aux_input_type_8 = parsed_json["auxInputType8"]
  aux_input_type_9 = parsed_json["auxInputType9"]
  camera_serial = parsed_json["cameraSerial"]
  created_at_time = unless parsed_json["createdAtTime"].nil?
  DateTime.parse(parsed_json["createdAtTime"])
else
  nil
end
  esn = parsed_json["esn"]
  external_ids = parsed_json["externalIds"]
  unless parsed_json["gateway"].nil?
    gateway = parsed_json["gateway"].to_json
    gateway = Samsara::Types::GoaGatewayTinyResponseResponseBody.from_json(json_object: gateway)
  else
    gateway = nil
  end
  harsh_acceleration_setting_type = parsed_json["harshAccelerationSettingType"]
  id = parsed_json["id"]
  license_plate = parsed_json["licensePlate"]
  make = parsed_json["make"]
  model = parsed_json["model"]
  name = parsed_json["name"]
  notes = parsed_json["notes"]
  unless parsed_json["sensorConfiguration"].nil?
    sensor_configuration = parsed_json["sensorConfiguration"].to_json
    sensor_configuration = Samsara::Types::VehicleSensorConfigurationResponseBody.from_json(json_object: sensor_configuration)
  else
    sensor_configuration = nil
  end
  serial = parsed_json["serial"]
  unless parsed_json["staticAssignedDriver"].nil?
    static_assigned_driver = parsed_json["staticAssignedDriver"].to_json
    static_assigned_driver = Samsara::Types::DriverObjectResponseBody.from_json(json_object: static_assigned_driver)
  else
    static_assigned_driver = nil
  end
  tags = parsed_json["tags"]&.map do | item |
  item = item.to_json
  Samsara::Types::GoaTagTinyResponseResponseBody.from_json(json_object: item)
end
  updated_at_time = unless parsed_json["updatedAtTime"].nil?
  DateTime.parse(parsed_json["updatedAtTime"])
else
  nil
end
  vehicle_regulation_mode = parsed_json["vehicleRegulationMode"]
  vehicle_type = parsed_json["vehicleType"]
  vehicle_weight = parsed_json["vehicleWeight"]
  vehicle_weight_in_kilograms = parsed_json["vehicleWeightInKilograms"]
  vehicle_weight_in_pounds = parsed_json["vehicleWeightInPounds"]
  vin = parsed_json["vin"]
  year = parsed_json["year"]
  new(
    attributes: attributes,
    aux_input_type_1: aux_input_type_1,
    aux_input_type_10: aux_input_type_10,
    aux_input_type_11: aux_input_type_11,
    aux_input_type_12: aux_input_type_12,
    aux_input_type_13: aux_input_type_13,
    aux_input_type_2: aux_input_type_2,
    aux_input_type_3: aux_input_type_3,
    aux_input_type_4: aux_input_type_4,
    aux_input_type_5: aux_input_type_5,
    aux_input_type_6: aux_input_type_6,
    aux_input_type_7: aux_input_type_7,
    aux_input_type_8: aux_input_type_8,
    aux_input_type_9: aux_input_type_9,
    camera_serial: camera_serial,
    created_at_time: created_at_time,
    esn: esn,
    external_ids: external_ids,
    gateway: gateway,
    harsh_acceleration_setting_type: harsh_acceleration_setting_type,
    id: id,
    license_plate: license_plate,
    make: make,
    model: model,
    name: name,
    notes: notes,
    sensor_configuration: sensor_configuration,
    serial: serial,
    static_assigned_driver: static_assigned_driver,
    tags: tags,
    updated_at_time: updated_at_time,
    vehicle_regulation_mode: vehicle_regulation_mode,
    vehicle_type: vehicle_type,
    vehicle_weight: vehicle_weight,
    vehicle_weight_in_kilograms: vehicle_weight_in_kilograms,
    vehicle_weight_in_pounds: vehicle_weight_in_pounds,
    vin: vin,
    year: year,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 326

def self.validate_raw(obj:)
  obj.attributes&.is_a?(Array) != false || raise("Passed value for field obj.attributes is not the expected type, validation failed.")
  obj.aux_input_type_1&.is_a?(String) != false || raise("Passed value for field obj.aux_input_type_1 is not the expected type, validation failed.")
  obj.aux_input_type_10&.is_a?(String) != false || raise("Passed value for field obj.aux_input_type_10 is not the expected type, validation failed.")
  obj.aux_input_type_11&.is_a?(String) != false || raise("Passed value for field obj.aux_input_type_11 is not the expected type, validation failed.")
  obj.aux_input_type_12&.is_a?(String) != false || raise("Passed value for field obj.aux_input_type_12 is not the expected type, validation failed.")
  obj.aux_input_type_13&.is_a?(String) != false || raise("Passed value for field obj.aux_input_type_13 is not the expected type, validation failed.")
  obj.aux_input_type_2&.is_a?(String) != false || raise("Passed value for field obj.aux_input_type_2 is not the expected type, validation failed.")
  obj.aux_input_type_3&.is_a?(String) != false || raise("Passed value for field obj.aux_input_type_3 is not the expected type, validation failed.")
  obj.aux_input_type_4&.is_a?(String) != false || raise("Passed value for field obj.aux_input_type_4 is not the expected type, validation failed.")
  obj.aux_input_type_5&.is_a?(String) != false || raise("Passed value for field obj.aux_input_type_5 is not the expected type, validation failed.")
  obj.aux_input_type_6&.is_a?(String) != false || raise("Passed value for field obj.aux_input_type_6 is not the expected type, validation failed.")
  obj.aux_input_type_7&.is_a?(String) != false || raise("Passed value for field obj.aux_input_type_7 is not the expected type, validation failed.")
  obj.aux_input_type_8&.is_a?(String) != false || raise("Passed value for field obj.aux_input_type_8 is not the expected type, validation failed.")
  obj.aux_input_type_9&.is_a?(String) != false || raise("Passed value for field obj.aux_input_type_9 is not the expected type, validation failed.")
  obj.camera_serial&.is_a?(String) != false || raise("Passed value for field obj.camera_serial 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.esn&.is_a?(String) != false || raise("Passed value for field obj.esn is not the expected type, validation failed.")
  obj.external_ids&.is_a?(Hash) != false || raise("Passed value for field obj.external_ids is not the expected type, validation failed.")
  obj.gateway.nil? || Samsara::Types::GoaGatewayTinyResponseResponseBody.validate_raw(obj: obj.gateway)
  obj.harsh_acceleration_setting_type&.is_a?(String) != false || raise("Passed value for field obj.harsh_acceleration_setting_type 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.license_plate&.is_a?(String) != false || raise("Passed value for field obj.license_plate is not the expected type, validation failed.")
  obj.make&.is_a?(String) != false || raise("Passed value for field obj.make is not the expected type, validation failed.")
  obj.model&.is_a?(String) != false || raise("Passed value for field obj.model is not the expected type, validation failed.")
  obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
  obj.notes&.is_a?(String) != false || raise("Passed value for field obj.notes is not the expected type, validation failed.")
  obj.sensor_configuration.nil? || Samsara::Types::VehicleSensorConfigurationResponseBody.validate_raw(obj: obj.sensor_configuration)
  obj.serial&.is_a?(String) != false || raise("Passed value for field obj.serial is not the expected type, validation failed.")
  obj.static_assigned_driver.nil? || Samsara::Types::DriverObjectResponseBody.validate_raw(obj: obj.static_assigned_driver)
  obj.tags&.is_a?(Array) != false || raise("Passed value for field obj.tags 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.")
  obj.vehicle_regulation_mode&.is_a?(Samsara::Types::VehicleResponseObjectResponseBodyVehicleRegulationMode) != false || raise("Passed value for field obj.vehicle_regulation_mode is not the expected type, validation failed.")
  obj.vehicle_type&.is_a?(Samsara::Types::VehicleResponseObjectResponseBodyVehicleType) != false || raise("Passed value for field obj.vehicle_type is not the expected type, validation failed.")
  obj.vehicle_weight&.is_a?(Long) != false || raise("Passed value for field obj.vehicle_weight is not the expected type, validation failed.")
  obj.vehicle_weight_in_kilograms&.is_a?(Long) != false || raise("Passed value for field obj.vehicle_weight_in_kilograms is not the expected type, validation failed.")
  obj.vehicle_weight_in_pounds&.is_a?(Long) != false || raise("Passed value for field obj.vehicle_weight_in_pounds is not the expected type, validation failed.")
  obj.vin&.is_a?(String) != false || raise("Passed value for field obj.vin is not the expected type, validation failed.")
  obj.year&.is_a?(String) != false || raise("Passed value for field obj.year is not the expected type, validation failed.")
end

Instance Method Details

#to_json ⇒ String

Returns:

  • (String)


317
318
319
# File 'lib/samsara_api/types/vehicle_response_object_response_body.rb', line 317

def to_json
  @_field_set&.to_json
end