samsara-api 4.1.1__py3-none-any.whl → 4.3.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. samsara/__init__.py +84 -15
  2. samsara/addresses/client.py +7 -14
  3. samsara/addresses/raw_client.py +7 -11
  4. samsara/alerts/client.py +2 -10
  5. samsara/alerts/raw_client.py +180 -180
  6. samsara/assets/__init__.py +3 -3
  7. samsara/assets/client.py +14 -45
  8. samsara/assets/raw_client.py +156 -160
  9. samsara/assets/types/__init__.py +3 -3
  10. samsara/assets/types/{assets_list_request_type.py → list_assets_request_type.py} +1 -1
  11. samsara/attributes/client.py +0 -4
  12. samsara/beta_ap_is/client.py +139 -189
  13. samsara/beta_ap_is/raw_client.py +2035 -1702
  14. samsara/carrier_proposed_assignments/client.py +2 -10
  15. samsara/client.py +5 -0
  16. samsara/coaching/client.py +2 -22
  17. samsara/coaching/raw_client.py +108 -108
  18. samsara/contacts/client.py +2 -8
  19. samsara/core/__init__.py +5 -0
  20. samsara/core/client_wrapper.py +18 -10
  21. samsara/core/custom_pagination.py +152 -0
  22. samsara/core/http_client.py +176 -90
  23. samsara/core/http_sse/__init__.py +42 -0
  24. samsara/core/http_sse/_api.py +112 -0
  25. samsara/core/http_sse/_decoders.py +61 -0
  26. samsara/core/http_sse/_exceptions.py +7 -0
  27. samsara/core/http_sse/_models.py +17 -0
  28. samsara/core/pagination.py +14 -14
  29. samsara/core/pydantic_utilities.py +3 -1
  30. samsara/documents/client.py +2 -12
  31. samsara/documents/raw_client.py +180 -180
  32. samsara/driver_qr_codes/raw_client.py +108 -108
  33. samsara/driver_vehicle_assignments/client.py +0 -12
  34. samsara/driver_vehicle_assignments/raw_client.py +144 -144
  35. samsara/drivers/__init__.py +3 -3
  36. samsara/drivers/client.py +12 -23
  37. samsara/drivers/raw_client.py +48 -52
  38. samsara/drivers/types/__init__.py +3 -3
  39. samsara/drivers/types/{drivers_list_request_driver_activation_status.py → list_drivers_request_driver_activation_status.py} +1 -1
  40. samsara/equipment/client.py +6 -22
  41. samsara/errors/bad_gateway_error.py +1 -1
  42. samsara/errors/gateway_timeout_error.py +1 -1
  43. samsara/errors/internal_server_error.py +1 -1
  44. samsara/errors/method_not_allowed_error.py +1 -1
  45. samsara/errors/not_found_error.py +1 -1
  46. samsara/errors/not_implemented_error.py +1 -1
  47. samsara/errors/service_unavailable_error.py +1 -1
  48. samsara/errors/too_many_requests_error.py +1 -1
  49. samsara/errors/unauthorized_error.py +1 -1
  50. samsara/forms/__init__.py +9 -3
  51. samsara/forms/client.py +17 -10
  52. samsara/forms/raw_client.py +265 -254
  53. samsara/forms/types/__init__.py +6 -2
  54. samsara/forms/types/form_submissions_post_form_submission_request_body_status.py +5 -0
  55. samsara/fuel_and_energy/client.py +0 -30
  56. samsara/fuel_and_energy/raw_client.py +180 -180
  57. samsara/gateways/client.py +2 -6
  58. samsara/gateways/raw_client.py +108 -108
  59. samsara/hours_of_service/__init__.py +6 -3
  60. samsara/hours_of_service/client.py +13 -52
  61. samsara/hours_of_service/raw_client.py +77 -76
  62. samsara/hours_of_service/types/__init__.py +4 -2
  63. samsara/hours_of_service/types/get_hos_daily_logs_request_expand.py +5 -0
  64. samsara/hubs/client.py +2 -94
  65. samsara/hubs/raw_client.py +216 -216
  66. samsara/idling/client.py +10 -16
  67. samsara/idling/raw_client.py +46 -36
  68. samsara/ifta/client.py +4 -34
  69. samsara/ifta/raw_client.py +144 -144
  70. samsara/industrial/client.py +12 -56
  71. samsara/industrial/raw_client.py +40 -48
  72. samsara/issues/client.py +0 -4
  73. samsara/issues/raw_client.py +108 -108
  74. samsara/legacy_ap_is/client.py +4 -56
  75. samsara/legacy_ap_is/raw_client.py +108 -108
  76. samsara/live_sharing_links/client.py +2 -10
  77. samsara/live_sharing_links/raw_client.py +144 -144
  78. samsara/location_and_speed/client.py +2 -20
  79. samsara/location_and_speed/raw_client.py +36 -36
  80. samsara/maintenance/__init__.py +3 -3
  81. samsara/maintenance/client.py +15 -30
  82. samsara/maintenance/raw_client.py +191 -182
  83. samsara/maintenance/types/__init__.py +6 -2
  84. samsara/maintenance/types/create_dvir_request_type.py +5 -0
  85. samsara/media/client.py +2 -16
  86. samsara/media/raw_client.py +108 -108
  87. samsara/messages/client.py +2 -8
  88. samsara/plans/client.py +0 -21
  89. samsara/plans/raw_client.py +72 -72
  90. samsara/preview_ap_is/client.py +0 -140
  91. samsara/preview_ap_is/raw_client.py +72 -430
  92. samsara/route_events/client.py +2 -12
  93. samsara/route_events/raw_client.py +36 -36
  94. samsara/routes/__init__.py +30 -0
  95. samsara/routes/client.py +7 -35
  96. samsara/routes/raw_client.py +257 -256
  97. samsara/routes/types/__init__.py +34 -0
  98. samsara/routes/types/get_routes_feed_request_expand.py +5 -0
  99. samsara/safety/client.py +2 -10
  100. samsara/safety/raw_client.py +36 -36
  101. samsara/settings/raw_client.py +180 -180
  102. samsara/speeding_intervals/raw_client.py +36 -36
  103. samsara/tachograph_eu_only/client.py +0 -6
  104. samsara/tags/client.py +2 -8
  105. samsara/trailer_assignments/client.py +2 -18
  106. samsara/trailers/client.py +2 -12
  107. samsara/trailers/raw_client.py +180 -180
  108. samsara/types/__init__.py +71 -6
  109. samsara/types/advanced_idling_get_idling_events_response_body.py +2 -2
  110. samsara/types/create_routes_stop_request_object_request_body.py +7 -0
  111. samsara/types/driver_assignment_object_response_body.py +2 -1
  112. samsara/types/driver_assignment_object_response_body_assignment_type.py +5 -0
  113. samsara/types/driver_external_ids.py +1 -1
  114. samsara/types/forms_approval_config_object_response_body.py +2 -1
  115. samsara/types/forms_approval_config_object_response_body_type.py +5 -0
  116. samsara/types/fuel_level_trigger_details_object_request_body.py +2 -1
  117. samsara/types/fuel_level_trigger_details_object_request_body_operation.py +5 -0
  118. samsara/types/fuel_level_trigger_details_object_response_body.py +4 -1
  119. samsara/types/fuel_level_trigger_details_object_response_body_operation.py +5 -0
  120. samsara/types/harsh_event_trigger_details_object_request_body_types_item.py +1 -0
  121. samsara/types/harsh_event_trigger_details_object_response_body_types_item.py +1 -0
  122. samsara/types/idling_event_address_object_response_body.py +46 -0
  123. samsara/types/{idling_event_object_response_body_address_type.py → idling_event_address_object_response_body_address_types_item.py} +1 -1
  124. samsara/types/idling_event_asset_object_response_body.py +35 -0
  125. samsara/types/{idling_event_object_response_body.py → idling_event_object_v_20251023_response_body.py} +18 -28
  126. samsara/types/idling_event_object_v_20251023_response_body_pto_state.py +5 -0
  127. samsara/types/idling_event_operator_object_response_body.py +35 -0
  128. samsara/types/patch_issue_request_body_assigned_to_request_body.py +2 -1
  129. samsara/types/patch_issue_request_body_assigned_to_request_body_type.py +5 -0
  130. samsara/types/reading_datapoint_request_body.py +5 -4
  131. samsara/types/reading_datapoint_request_body_entity_type.py +5 -0
  132. samsara/types/reading_history_response_body.py +1 -1
  133. samsara/types/reading_snapshot_response_body.py +1 -1
  134. samsara/types/resolved_by.py +2 -1
  135. samsara/types/resolved_by_type.py +5 -0
  136. samsara/types/route_feed_object_response_body.py +2 -1
  137. samsara/types/route_feed_object_response_body_type.py +5 -0
  138. samsara/types/route_settings_request_body.py +8 -0
  139. samsara/types/route_settings_request_body_sequencing_method.py +7 -0
  140. samsara/types/route_settings_response_body.py +8 -0
  141. samsara/types/route_settings_response_body_sequencing_method.py +7 -0
  142. samsara/types/route_stop_details_object_response_body.py +2 -1
  143. samsara/types/route_stop_details_object_response_body_type.py +5 -0
  144. samsara/types/routes_stop_response_object_response_body.py +7 -0
  145. samsara/types/training_learner_object_response_body.py +2 -1
  146. samsara/types/training_learner_object_response_body_type.py +5 -0
  147. samsara/types/update_routes_stop_request_object_request_body.py +7 -0
  148. samsara/types/vehicle_assignment_object_response_body.py +4 -3
  149. samsara/types/vehicle_assignment_object_response_body_assignment_type.py +5 -0
  150. samsara/types/vehicle_external_ids.py +1 -1
  151. samsara/types/work_order_money_object_request_body.py +2 -1
  152. samsara/types/work_order_money_object_request_body_currency.py +5 -0
  153. samsara/types/work_order_money_object_response_body.py +2 -1
  154. samsara/types/work_order_money_object_response_body_currency.py +5 -0
  155. samsara/users/client.py +4 -16
  156. samsara/vehicle_locations/client.py +4 -16
  157. samsara/vehicles/client.py +7 -22
  158. samsara/vehicles/raw_client.py +43 -47
  159. samsara/webhooks/client.py +2 -10
  160. samsara/webhooks/raw_client.py +180 -180
  161. samsara/work_orders/client.py +4 -18
  162. samsara/work_orders/raw_client.py +216 -216
  163. {samsara_api-4.1.1.dist-info → samsara_api-4.3.0.dist-info}/METADATA +2 -1
  164. {samsara_api-4.1.1.dist-info → samsara_api-4.3.0.dist-info}/RECORD +166 -136
  165. {samsara_api-4.1.1.dist-info → samsara_api-4.3.0.dist-info}/LICENSE +0 -0
  166. {samsara_api-4.1.1.dist-info → samsara_api-4.3.0.dist-info}/WHEEL +0 -0
samsara/plans/client.py CHANGED
@@ -123,8 +123,6 @@ class PlansClient:
123
123
 
124
124
  Examples
125
125
  --------
126
- import datetime
127
-
128
126
  from samsara import Samsara
129
127
 
130
128
  client = Samsara(
@@ -132,15 +130,6 @@ class PlansClient:
132
130
  )
133
131
  client.plans.list_hub_plans(
134
132
  hub_id="hubId",
135
- plan_ids="planIds",
136
- start_time=datetime.datetime.fromisoformat(
137
- "2024-01-15 09:30:00+00:00",
138
- ),
139
- end_time=datetime.datetime.fromisoformat(
140
- "2024-01-15 09:30:00+00:00",
141
- ),
142
- after="after",
143
- limit=1,
144
133
  )
145
134
  """
146
135
  _response = self._raw_client.list_hub_plans(
@@ -274,7 +263,6 @@ class AsyncPlansClient:
274
263
  Examples
275
264
  --------
276
265
  import asyncio
277
- import datetime
278
266
 
279
267
  from samsara import AsyncSamsara
280
268
 
@@ -286,15 +274,6 @@ class AsyncPlansClient:
286
274
  async def main() -> None:
287
275
  await client.plans.list_hub_plans(
288
276
  hub_id="hubId",
289
- plan_ids="planIds",
290
- start_time=datetime.datetime.fromisoformat(
291
- "2024-01-15 09:30:00+00:00",
292
- ),
293
- end_time=datetime.datetime.fromisoformat(
294
- "2024-01-15 09:30:00+00:00",
295
- ),
296
- after="after",
297
- limit=1,
298
277
  )
299
278
 
300
279
 
@@ -86,9 +86,9 @@ class RawPlansClient:
86
86
  raise UnauthorizedError(
87
87
  headers=dict(_response.headers),
88
88
  body=typing.cast(
89
- typing.Optional[typing.Any],
89
+ typing.Any,
90
90
  parse_obj_as(
91
- type_=typing.Optional[typing.Any], # type: ignore
91
+ type_=typing.Any, # type: ignore
92
92
  object_=_response.json(),
93
93
  ),
94
94
  ),
@@ -97,9 +97,9 @@ class RawPlansClient:
97
97
  raise NotFoundError(
98
98
  headers=dict(_response.headers),
99
99
  body=typing.cast(
100
- typing.Optional[typing.Any],
100
+ typing.Any,
101
101
  parse_obj_as(
102
- type_=typing.Optional[typing.Any], # type: ignore
102
+ type_=typing.Any, # type: ignore
103
103
  object_=_response.json(),
104
104
  ),
105
105
  ),
@@ -108,9 +108,9 @@ class RawPlansClient:
108
108
  raise MethodNotAllowedError(
109
109
  headers=dict(_response.headers),
110
110
  body=typing.cast(
111
- typing.Optional[typing.Any],
111
+ typing.Any,
112
112
  parse_obj_as(
113
- type_=typing.Optional[typing.Any], # type: ignore
113
+ type_=typing.Any, # type: ignore
114
114
  object_=_response.json(),
115
115
  ),
116
116
  ),
@@ -119,9 +119,9 @@ class RawPlansClient:
119
119
  raise TooManyRequestsError(
120
120
  headers=dict(_response.headers),
121
121
  body=typing.cast(
122
- typing.Optional[typing.Any],
122
+ typing.Any,
123
123
  parse_obj_as(
124
- type_=typing.Optional[typing.Any], # type: ignore
124
+ type_=typing.Any, # type: ignore
125
125
  object_=_response.json(),
126
126
  ),
127
127
  ),
@@ -130,9 +130,9 @@ class RawPlansClient:
130
130
  raise InternalServerError(
131
131
  headers=dict(_response.headers),
132
132
  body=typing.cast(
133
- typing.Optional[typing.Any],
133
+ typing.Any,
134
134
  parse_obj_as(
135
- type_=typing.Optional[typing.Any], # type: ignore
135
+ type_=typing.Any, # type: ignore
136
136
  object_=_response.json(),
137
137
  ),
138
138
  ),
@@ -141,9 +141,9 @@ class RawPlansClient:
141
141
  raise NotImplementedError(
142
142
  headers=dict(_response.headers),
143
143
  body=typing.cast(
144
- typing.Optional[typing.Any],
144
+ typing.Any,
145
145
  parse_obj_as(
146
- type_=typing.Optional[typing.Any], # type: ignore
146
+ type_=typing.Any, # type: ignore
147
147
  object_=_response.json(),
148
148
  ),
149
149
  ),
@@ -152,9 +152,9 @@ class RawPlansClient:
152
152
  raise BadGatewayError(
153
153
  headers=dict(_response.headers),
154
154
  body=typing.cast(
155
- typing.Optional[typing.Any],
155
+ typing.Any,
156
156
  parse_obj_as(
157
- type_=typing.Optional[typing.Any], # type: ignore
157
+ type_=typing.Any, # type: ignore
158
158
  object_=_response.json(),
159
159
  ),
160
160
  ),
@@ -163,9 +163,9 @@ class RawPlansClient:
163
163
  raise ServiceUnavailableError(
164
164
  headers=dict(_response.headers),
165
165
  body=typing.cast(
166
- typing.Optional[typing.Any],
166
+ typing.Any,
167
167
  parse_obj_as(
168
- type_=typing.Optional[typing.Any], # type: ignore
168
+ type_=typing.Any, # type: ignore
169
169
  object_=_response.json(),
170
170
  ),
171
171
  ),
@@ -174,9 +174,9 @@ class RawPlansClient:
174
174
  raise GatewayTimeoutError(
175
175
  headers=dict(_response.headers),
176
176
  body=typing.cast(
177
- typing.Optional[typing.Any],
177
+ typing.Any,
178
178
  parse_obj_as(
179
- type_=typing.Optional[typing.Any], # type: ignore
179
+ type_=typing.Any, # type: ignore
180
180
  object_=_response.json(),
181
181
  ),
182
182
  ),
@@ -262,9 +262,9 @@ class RawPlansClient:
262
262
  raise UnauthorizedError(
263
263
  headers=dict(_response.headers),
264
264
  body=typing.cast(
265
- typing.Optional[typing.Any],
265
+ typing.Any,
266
266
  parse_obj_as(
267
- type_=typing.Optional[typing.Any], # type: ignore
267
+ type_=typing.Any, # type: ignore
268
268
  object_=_response.json(),
269
269
  ),
270
270
  ),
@@ -273,9 +273,9 @@ class RawPlansClient:
273
273
  raise NotFoundError(
274
274
  headers=dict(_response.headers),
275
275
  body=typing.cast(
276
- typing.Optional[typing.Any],
276
+ typing.Any,
277
277
  parse_obj_as(
278
- type_=typing.Optional[typing.Any], # type: ignore
278
+ type_=typing.Any, # type: ignore
279
279
  object_=_response.json(),
280
280
  ),
281
281
  ),
@@ -284,9 +284,9 @@ class RawPlansClient:
284
284
  raise MethodNotAllowedError(
285
285
  headers=dict(_response.headers),
286
286
  body=typing.cast(
287
- typing.Optional[typing.Any],
287
+ typing.Any,
288
288
  parse_obj_as(
289
- type_=typing.Optional[typing.Any], # type: ignore
289
+ type_=typing.Any, # type: ignore
290
290
  object_=_response.json(),
291
291
  ),
292
292
  ),
@@ -295,9 +295,9 @@ class RawPlansClient:
295
295
  raise TooManyRequestsError(
296
296
  headers=dict(_response.headers),
297
297
  body=typing.cast(
298
- typing.Optional[typing.Any],
298
+ typing.Any,
299
299
  parse_obj_as(
300
- type_=typing.Optional[typing.Any], # type: ignore
300
+ type_=typing.Any, # type: ignore
301
301
  object_=_response.json(),
302
302
  ),
303
303
  ),
@@ -306,9 +306,9 @@ class RawPlansClient:
306
306
  raise InternalServerError(
307
307
  headers=dict(_response.headers),
308
308
  body=typing.cast(
309
- typing.Optional[typing.Any],
309
+ typing.Any,
310
310
  parse_obj_as(
311
- type_=typing.Optional[typing.Any], # type: ignore
311
+ type_=typing.Any, # type: ignore
312
312
  object_=_response.json(),
313
313
  ),
314
314
  ),
@@ -317,9 +317,9 @@ class RawPlansClient:
317
317
  raise NotImplementedError(
318
318
  headers=dict(_response.headers),
319
319
  body=typing.cast(
320
- typing.Optional[typing.Any],
320
+ typing.Any,
321
321
  parse_obj_as(
322
- type_=typing.Optional[typing.Any], # type: ignore
322
+ type_=typing.Any, # type: ignore
323
323
  object_=_response.json(),
324
324
  ),
325
325
  ),
@@ -328,9 +328,9 @@ class RawPlansClient:
328
328
  raise BadGatewayError(
329
329
  headers=dict(_response.headers),
330
330
  body=typing.cast(
331
- typing.Optional[typing.Any],
331
+ typing.Any,
332
332
  parse_obj_as(
333
- type_=typing.Optional[typing.Any], # type: ignore
333
+ type_=typing.Any, # type: ignore
334
334
  object_=_response.json(),
335
335
  ),
336
336
  ),
@@ -339,9 +339,9 @@ class RawPlansClient:
339
339
  raise ServiceUnavailableError(
340
340
  headers=dict(_response.headers),
341
341
  body=typing.cast(
342
- typing.Optional[typing.Any],
342
+ typing.Any,
343
343
  parse_obj_as(
344
- type_=typing.Optional[typing.Any], # type: ignore
344
+ type_=typing.Any, # type: ignore
345
345
  object_=_response.json(),
346
346
  ),
347
347
  ),
@@ -350,9 +350,9 @@ class RawPlansClient:
350
350
  raise GatewayTimeoutError(
351
351
  headers=dict(_response.headers),
352
352
  body=typing.cast(
353
- typing.Optional[typing.Any],
353
+ typing.Any,
354
354
  parse_obj_as(
355
- type_=typing.Optional[typing.Any], # type: ignore
355
+ type_=typing.Any, # type: ignore
356
356
  object_=_response.json(),
357
357
  ),
358
358
  ),
@@ -423,9 +423,9 @@ class AsyncRawPlansClient:
423
423
  raise UnauthorizedError(
424
424
  headers=dict(_response.headers),
425
425
  body=typing.cast(
426
- typing.Optional[typing.Any],
426
+ typing.Any,
427
427
  parse_obj_as(
428
- type_=typing.Optional[typing.Any], # type: ignore
428
+ type_=typing.Any, # type: ignore
429
429
  object_=_response.json(),
430
430
  ),
431
431
  ),
@@ -434,9 +434,9 @@ class AsyncRawPlansClient:
434
434
  raise NotFoundError(
435
435
  headers=dict(_response.headers),
436
436
  body=typing.cast(
437
- typing.Optional[typing.Any],
437
+ typing.Any,
438
438
  parse_obj_as(
439
- type_=typing.Optional[typing.Any], # type: ignore
439
+ type_=typing.Any, # type: ignore
440
440
  object_=_response.json(),
441
441
  ),
442
442
  ),
@@ -445,9 +445,9 @@ class AsyncRawPlansClient:
445
445
  raise MethodNotAllowedError(
446
446
  headers=dict(_response.headers),
447
447
  body=typing.cast(
448
- typing.Optional[typing.Any],
448
+ typing.Any,
449
449
  parse_obj_as(
450
- type_=typing.Optional[typing.Any], # type: ignore
450
+ type_=typing.Any, # type: ignore
451
451
  object_=_response.json(),
452
452
  ),
453
453
  ),
@@ -456,9 +456,9 @@ class AsyncRawPlansClient:
456
456
  raise TooManyRequestsError(
457
457
  headers=dict(_response.headers),
458
458
  body=typing.cast(
459
- typing.Optional[typing.Any],
459
+ typing.Any,
460
460
  parse_obj_as(
461
- type_=typing.Optional[typing.Any], # type: ignore
461
+ type_=typing.Any, # type: ignore
462
462
  object_=_response.json(),
463
463
  ),
464
464
  ),
@@ -467,9 +467,9 @@ class AsyncRawPlansClient:
467
467
  raise InternalServerError(
468
468
  headers=dict(_response.headers),
469
469
  body=typing.cast(
470
- typing.Optional[typing.Any],
470
+ typing.Any,
471
471
  parse_obj_as(
472
- type_=typing.Optional[typing.Any], # type: ignore
472
+ type_=typing.Any, # type: ignore
473
473
  object_=_response.json(),
474
474
  ),
475
475
  ),
@@ -478,9 +478,9 @@ class AsyncRawPlansClient:
478
478
  raise NotImplementedError(
479
479
  headers=dict(_response.headers),
480
480
  body=typing.cast(
481
- typing.Optional[typing.Any],
481
+ typing.Any,
482
482
  parse_obj_as(
483
- type_=typing.Optional[typing.Any], # type: ignore
483
+ type_=typing.Any, # type: ignore
484
484
  object_=_response.json(),
485
485
  ),
486
486
  ),
@@ -489,9 +489,9 @@ class AsyncRawPlansClient:
489
489
  raise BadGatewayError(
490
490
  headers=dict(_response.headers),
491
491
  body=typing.cast(
492
- typing.Optional[typing.Any],
492
+ typing.Any,
493
493
  parse_obj_as(
494
- type_=typing.Optional[typing.Any], # type: ignore
494
+ type_=typing.Any, # type: ignore
495
495
  object_=_response.json(),
496
496
  ),
497
497
  ),
@@ -500,9 +500,9 @@ class AsyncRawPlansClient:
500
500
  raise ServiceUnavailableError(
501
501
  headers=dict(_response.headers),
502
502
  body=typing.cast(
503
- typing.Optional[typing.Any],
503
+ typing.Any,
504
504
  parse_obj_as(
505
- type_=typing.Optional[typing.Any], # type: ignore
505
+ type_=typing.Any, # type: ignore
506
506
  object_=_response.json(),
507
507
  ),
508
508
  ),
@@ -511,9 +511,9 @@ class AsyncRawPlansClient:
511
511
  raise GatewayTimeoutError(
512
512
  headers=dict(_response.headers),
513
513
  body=typing.cast(
514
- typing.Optional[typing.Any],
514
+ typing.Any,
515
515
  parse_obj_as(
516
- type_=typing.Optional[typing.Any], # type: ignore
516
+ type_=typing.Any, # type: ignore
517
517
  object_=_response.json(),
518
518
  ),
519
519
  ),
@@ -599,9 +599,9 @@ class AsyncRawPlansClient:
599
599
  raise UnauthorizedError(
600
600
  headers=dict(_response.headers),
601
601
  body=typing.cast(
602
- typing.Optional[typing.Any],
602
+ typing.Any,
603
603
  parse_obj_as(
604
- type_=typing.Optional[typing.Any], # type: ignore
604
+ type_=typing.Any, # type: ignore
605
605
  object_=_response.json(),
606
606
  ),
607
607
  ),
@@ -610,9 +610,9 @@ class AsyncRawPlansClient:
610
610
  raise NotFoundError(
611
611
  headers=dict(_response.headers),
612
612
  body=typing.cast(
613
- typing.Optional[typing.Any],
613
+ typing.Any,
614
614
  parse_obj_as(
615
- type_=typing.Optional[typing.Any], # type: ignore
615
+ type_=typing.Any, # type: ignore
616
616
  object_=_response.json(),
617
617
  ),
618
618
  ),
@@ -621,9 +621,9 @@ class AsyncRawPlansClient:
621
621
  raise MethodNotAllowedError(
622
622
  headers=dict(_response.headers),
623
623
  body=typing.cast(
624
- typing.Optional[typing.Any],
624
+ typing.Any,
625
625
  parse_obj_as(
626
- type_=typing.Optional[typing.Any], # type: ignore
626
+ type_=typing.Any, # type: ignore
627
627
  object_=_response.json(),
628
628
  ),
629
629
  ),
@@ -632,9 +632,9 @@ class AsyncRawPlansClient:
632
632
  raise TooManyRequestsError(
633
633
  headers=dict(_response.headers),
634
634
  body=typing.cast(
635
- typing.Optional[typing.Any],
635
+ typing.Any,
636
636
  parse_obj_as(
637
- type_=typing.Optional[typing.Any], # type: ignore
637
+ type_=typing.Any, # type: ignore
638
638
  object_=_response.json(),
639
639
  ),
640
640
  ),
@@ -643,9 +643,9 @@ class AsyncRawPlansClient:
643
643
  raise InternalServerError(
644
644
  headers=dict(_response.headers),
645
645
  body=typing.cast(
646
- typing.Optional[typing.Any],
646
+ typing.Any,
647
647
  parse_obj_as(
648
- type_=typing.Optional[typing.Any], # type: ignore
648
+ type_=typing.Any, # type: ignore
649
649
  object_=_response.json(),
650
650
  ),
651
651
  ),
@@ -654,9 +654,9 @@ class AsyncRawPlansClient:
654
654
  raise NotImplementedError(
655
655
  headers=dict(_response.headers),
656
656
  body=typing.cast(
657
- typing.Optional[typing.Any],
657
+ typing.Any,
658
658
  parse_obj_as(
659
- type_=typing.Optional[typing.Any], # type: ignore
659
+ type_=typing.Any, # type: ignore
660
660
  object_=_response.json(),
661
661
  ),
662
662
  ),
@@ -665,9 +665,9 @@ class AsyncRawPlansClient:
665
665
  raise BadGatewayError(
666
666
  headers=dict(_response.headers),
667
667
  body=typing.cast(
668
- typing.Optional[typing.Any],
668
+ typing.Any,
669
669
  parse_obj_as(
670
- type_=typing.Optional[typing.Any], # type: ignore
670
+ type_=typing.Any, # type: ignore
671
671
  object_=_response.json(),
672
672
  ),
673
673
  ),
@@ -676,9 +676,9 @@ class AsyncRawPlansClient:
676
676
  raise ServiceUnavailableError(
677
677
  headers=dict(_response.headers),
678
678
  body=typing.cast(
679
- typing.Optional[typing.Any],
679
+ typing.Any,
680
680
  parse_obj_as(
681
- type_=typing.Optional[typing.Any], # type: ignore
681
+ type_=typing.Any, # type: ignore
682
682
  object_=_response.json(),
683
683
  ),
684
684
  ),
@@ -687,9 +687,9 @@ class AsyncRawPlansClient:
687
687
  raise GatewayTimeoutError(
688
688
  headers=dict(_response.headers),
689
689
  body=typing.cast(
690
- typing.Optional[typing.Any],
690
+ typing.Any,
691
691
  parse_obj_as(
692
- type_=typing.Optional[typing.Any], # type: ignore
692
+ type_=typing.Any, # type: ignore
693
693
  object_=_response.json(),
694
694
  ),
695
695
  ),
@@ -4,14 +4,8 @@ import typing
4
4
 
5
5
  from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
6
6
  from ..core.request_options import RequestOptions
7
- from ..types.drivers_auth_token_create_driver_auth_token_response_body import (
8
- DriversAuthTokenCreateDriverAuthTokenResponseBody,
9
- )
10
7
  from .raw_client import AsyncRawPreviewApIsClient, RawPreviewApIsClient
11
8
 
12
- # this is used as the default value for optional parameters
13
- OMIT = typing.cast(typing.Any, ...)
14
-
15
9
 
16
10
  class PreviewApIsClient:
17
11
  def __init__(self, *, client_wrapper: SyncClientWrapper):
@@ -28,69 +22,6 @@ class PreviewApIsClient:
28
22
  """
29
23
  return self._raw_client
30
24
 
31
- def create_driver_auth_token(
32
- self,
33
- *,
34
- code: str,
35
- external_id: typing.Optional[str] = OMIT,
36
- id: typing.Optional[int] = OMIT,
37
- username: typing.Optional[str] = OMIT,
38
- request_options: typing.Optional[RequestOptions] = None,
39
- ) -> DriversAuthTokenCreateDriverAuthTokenResponseBody:
40
- """
41
- Creates a short-lived auth token for a driver.
42
-
43
- <b>Rate limit:</b> 100 requests/min (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).
44
-
45
- To use this endpoint, select **Write Driver Auth Token** under the Closed Beta category when creating or editing an API token. <a href="https://developers.samsara.com/docs/authentication#scopes-for-api-tokens" target="_blank">Learn More.</a>
46
-
47
- Endpoints in this section are in Preview. These APIs are not functional and are instead for soliciting feedback from our API users on the intended design of this API. Additionally, it is not guaranteed that we will be releasing an endpoint included in this section to production. This means that developers should **NOT** rely on these APIs to build business critical applications
48
-
49
- - Samsara may change the structure of a preview API's interface without versioning or any notice to API users.
50
-
51
- - When an endpoint becomes generally available, it will be announced in the API [changelog](https://developers.samsara.com/changelog).
52
-
53
-
54
- **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our <a href="https://forms.gle/zkD4NCH7HjKb7mm69" target="_blank">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href="https://www.samsara.com/help" target="_blank">submit a case</a> to our support team.
55
-
56
- Parameters
57
- ----------
58
- code : str
59
- Required. Random 12+ character string, used with the auth token to help secure the client from intercepted tokens.
60
-
61
- external_id : typing.Optional[str]
62
- Optional. External ID of the driver, in the format `key:value` (e.g., `payrollId:ABFS18600`). One of `id`, `externalId`, or `username` is required.
63
-
64
- id : typing.Optional[int]
65
- Optional. Samsara ID of the driver. One of `id`, `externalId`, or `username` is required.
66
-
67
- username : typing.Optional[str]
68
- Optional. Username of the driver. This is the login identifier configured when the driver is created. One of `id`, `externalId`, or `username` is required.
69
-
70
- request_options : typing.Optional[RequestOptions]
71
- Request-specific configuration.
72
-
73
- Returns
74
- -------
75
- DriversAuthTokenCreateDriverAuthTokenResponseBody
76
- OK response.
77
-
78
- Examples
79
- --------
80
- from samsara import Samsara
81
-
82
- client = Samsara(
83
- token="YOUR_TOKEN",
84
- )
85
- client.preview_ap_is.create_driver_auth_token(
86
- code="dp[gZc1wAigz4uGa0Hh",
87
- )
88
- """
89
- _response = self._raw_client.create_driver_auth_token(
90
- code=code, external_id=external_id, id=id, username=username, request_options=request_options
91
- )
92
- return _response.data
93
-
94
25
  def lock_vehicle(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
95
26
  """
96
27
  Lock a vehicle. This requires a vehicle gateway with locking capabilities.
@@ -193,77 +124,6 @@ class AsyncPreviewApIsClient:
193
124
  """
194
125
  return self._raw_client
195
126
 
196
- async def create_driver_auth_token(
197
- self,
198
- *,
199
- code: str,
200
- external_id: typing.Optional[str] = OMIT,
201
- id: typing.Optional[int] = OMIT,
202
- username: typing.Optional[str] = OMIT,
203
- request_options: typing.Optional[RequestOptions] = None,
204
- ) -> DriversAuthTokenCreateDriverAuthTokenResponseBody:
205
- """
206
- Creates a short-lived auth token for a driver.
207
-
208
- <b>Rate limit:</b> 100 requests/min (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).
209
-
210
- To use this endpoint, select **Write Driver Auth Token** under the Closed Beta category when creating or editing an API token. <a href="https://developers.samsara.com/docs/authentication#scopes-for-api-tokens" target="_blank">Learn More.</a>
211
-
212
- Endpoints in this section are in Preview. These APIs are not functional and are instead for soliciting feedback from our API users on the intended design of this API. Additionally, it is not guaranteed that we will be releasing an endpoint included in this section to production. This means that developers should **NOT** rely on these APIs to build business critical applications
213
-
214
- - Samsara may change the structure of a preview API's interface without versioning or any notice to API users.
215
-
216
- - When an endpoint becomes generally available, it will be announced in the API [changelog](https://developers.samsara.com/changelog).
217
-
218
-
219
- **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our <a href="https://forms.gle/zkD4NCH7HjKb7mm69" target="_blank">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href="https://www.samsara.com/help" target="_blank">submit a case</a> to our support team.
220
-
221
- Parameters
222
- ----------
223
- code : str
224
- Required. Random 12+ character string, used with the auth token to help secure the client from intercepted tokens.
225
-
226
- external_id : typing.Optional[str]
227
- Optional. External ID of the driver, in the format `key:value` (e.g., `payrollId:ABFS18600`). One of `id`, `externalId`, or `username` is required.
228
-
229
- id : typing.Optional[int]
230
- Optional. Samsara ID of the driver. One of `id`, `externalId`, or `username` is required.
231
-
232
- username : typing.Optional[str]
233
- Optional. Username of the driver. This is the login identifier configured when the driver is created. One of `id`, `externalId`, or `username` is required.
234
-
235
- request_options : typing.Optional[RequestOptions]
236
- Request-specific configuration.
237
-
238
- Returns
239
- -------
240
- DriversAuthTokenCreateDriverAuthTokenResponseBody
241
- OK response.
242
-
243
- Examples
244
- --------
245
- import asyncio
246
-
247
- from samsara import AsyncSamsara
248
-
249
- client = AsyncSamsara(
250
- token="YOUR_TOKEN",
251
- )
252
-
253
-
254
- async def main() -> None:
255
- await client.preview_ap_is.create_driver_auth_token(
256
- code="dp[gZc1wAigz4uGa0Hh",
257
- )
258
-
259
-
260
- asyncio.run(main())
261
- """
262
- _response = await self._raw_client.create_driver_auth_token(
263
- code=code, external_id=external_id, id=id, username=username, request_options=request_options
264
- )
265
- return _response.data
266
-
267
127
  async def lock_vehicle(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
268
128
  """
269
129
  Lock a vehicle. This requires a vehicle gateway with locking capabilities.