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
@@ -0,0 +1,34 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
5
+ import typing
6
+ from importlib import import_module
7
+
8
+ if typing.TYPE_CHECKING:
9
+ from .get_routes_feed_request_expand import GetRoutesFeedRequestExpand
10
+ _dynamic_imports: typing.Dict[str, str] = {"GetRoutesFeedRequestExpand": ".get_routes_feed_request_expand"}
11
+
12
+
13
+ def __getattr__(attr_name: str) -> typing.Any:
14
+ module_name = _dynamic_imports.get(attr_name)
15
+ if module_name is None:
16
+ raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
17
+ try:
18
+ module = import_module(module_name, __package__)
19
+ if module_name == f".{attr_name}":
20
+ return module
21
+ else:
22
+ return getattr(module, attr_name)
23
+ except ImportError as e:
24
+ raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
25
+ except AttributeError as e:
26
+ raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
27
+
28
+
29
+ def __dir__():
30
+ lazy_attrs = list(_dynamic_imports.keys())
31
+ return sorted(lazy_attrs)
32
+
33
+
34
+ __all__ = ["GetRoutesFeedRequestExpand"]
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ GetRoutesFeedRequestExpand = typing.Union[typing.Literal["route"], typing.Any]
samsara/safety/client.py CHANGED
@@ -83,7 +83,6 @@ class SafetyClient:
83
83
  token="YOUR_TOKEN",
84
84
  )
85
85
  client.safety.get_safety_events(
86
- after="after",
87
86
  start_time="startTime",
88
87
  end_time="endTime",
89
88
  )
@@ -145,10 +144,7 @@ class SafetyClient:
145
144
  client = Samsara(
146
145
  token="YOUR_TOKEN",
147
146
  )
148
- client.safety.get_safety_activity_event_feed(
149
- after="after",
150
- start_time="startTime",
151
- )
147
+ client.safety.get_safety_activity_event_feed()
152
148
  """
153
149
  _response = self._raw_client.get_safety_activity_event_feed(
154
150
  after=after, start_time=start_time, request_options=request_options
@@ -392,7 +388,6 @@ class AsyncSafetyClient:
392
388
 
393
389
  async def main() -> None:
394
390
  await client.safety.get_safety_events(
395
- after="after",
396
391
  start_time="startTime",
397
392
  end_time="endTime",
398
393
  )
@@ -462,10 +457,7 @@ class AsyncSafetyClient:
462
457
 
463
458
 
464
459
  async def main() -> None:
465
- await client.safety.get_safety_activity_event_feed(
466
- after="after",
467
- start_time="startTime",
468
- )
460
+ await client.safety.get_safety_activity_event_feed()
469
461
 
470
462
 
471
463
  asyncio.run(main())
@@ -167,9 +167,9 @@ class RawSafetyClient:
167
167
  raise UnauthorizedError(
168
168
  headers=dict(_response.headers),
169
169
  body=typing.cast(
170
- typing.Optional[typing.Any],
170
+ typing.Any,
171
171
  parse_obj_as(
172
- type_=typing.Optional[typing.Any], # type: ignore
172
+ type_=typing.Any, # type: ignore
173
173
  object_=_response.json(),
174
174
  ),
175
175
  ),
@@ -178,9 +178,9 @@ class RawSafetyClient:
178
178
  raise NotFoundError(
179
179
  headers=dict(_response.headers),
180
180
  body=typing.cast(
181
- typing.Optional[typing.Any],
181
+ typing.Any,
182
182
  parse_obj_as(
183
- type_=typing.Optional[typing.Any], # type: ignore
183
+ type_=typing.Any, # type: ignore
184
184
  object_=_response.json(),
185
185
  ),
186
186
  ),
@@ -189,9 +189,9 @@ class RawSafetyClient:
189
189
  raise MethodNotAllowedError(
190
190
  headers=dict(_response.headers),
191
191
  body=typing.cast(
192
- typing.Optional[typing.Any],
192
+ typing.Any,
193
193
  parse_obj_as(
194
- type_=typing.Optional[typing.Any], # type: ignore
194
+ type_=typing.Any, # type: ignore
195
195
  object_=_response.json(),
196
196
  ),
197
197
  ),
@@ -200,9 +200,9 @@ class RawSafetyClient:
200
200
  raise TooManyRequestsError(
201
201
  headers=dict(_response.headers),
202
202
  body=typing.cast(
203
- typing.Optional[typing.Any],
203
+ typing.Any,
204
204
  parse_obj_as(
205
- type_=typing.Optional[typing.Any], # type: ignore
205
+ type_=typing.Any, # type: ignore
206
206
  object_=_response.json(),
207
207
  ),
208
208
  ),
@@ -211,9 +211,9 @@ class RawSafetyClient:
211
211
  raise InternalServerError(
212
212
  headers=dict(_response.headers),
213
213
  body=typing.cast(
214
- typing.Optional[typing.Any],
214
+ typing.Any,
215
215
  parse_obj_as(
216
- type_=typing.Optional[typing.Any], # type: ignore
216
+ type_=typing.Any, # type: ignore
217
217
  object_=_response.json(),
218
218
  ),
219
219
  ),
@@ -222,9 +222,9 @@ class RawSafetyClient:
222
222
  raise NotImplementedError(
223
223
  headers=dict(_response.headers),
224
224
  body=typing.cast(
225
- typing.Optional[typing.Any],
225
+ typing.Any,
226
226
  parse_obj_as(
227
- type_=typing.Optional[typing.Any], # type: ignore
227
+ type_=typing.Any, # type: ignore
228
228
  object_=_response.json(),
229
229
  ),
230
230
  ),
@@ -233,9 +233,9 @@ class RawSafetyClient:
233
233
  raise BadGatewayError(
234
234
  headers=dict(_response.headers),
235
235
  body=typing.cast(
236
- typing.Optional[typing.Any],
236
+ typing.Any,
237
237
  parse_obj_as(
238
- type_=typing.Optional[typing.Any], # type: ignore
238
+ type_=typing.Any, # type: ignore
239
239
  object_=_response.json(),
240
240
  ),
241
241
  ),
@@ -244,9 +244,9 @@ class RawSafetyClient:
244
244
  raise ServiceUnavailableError(
245
245
  headers=dict(_response.headers),
246
246
  body=typing.cast(
247
- typing.Optional[typing.Any],
247
+ typing.Any,
248
248
  parse_obj_as(
249
- type_=typing.Optional[typing.Any], # type: ignore
249
+ type_=typing.Any, # type: ignore
250
250
  object_=_response.json(),
251
251
  ),
252
252
  ),
@@ -255,9 +255,9 @@ class RawSafetyClient:
255
255
  raise GatewayTimeoutError(
256
256
  headers=dict(_response.headers),
257
257
  body=typing.cast(
258
- typing.Optional[typing.Any],
258
+ typing.Any,
259
259
  parse_obj_as(
260
- type_=typing.Optional[typing.Any], # type: ignore
260
+ type_=typing.Any, # type: ignore
261
261
  object_=_response.json(),
262
262
  ),
263
263
  ),
@@ -588,9 +588,9 @@ class AsyncRawSafetyClient:
588
588
  raise UnauthorizedError(
589
589
  headers=dict(_response.headers),
590
590
  body=typing.cast(
591
- typing.Optional[typing.Any],
591
+ typing.Any,
592
592
  parse_obj_as(
593
- type_=typing.Optional[typing.Any], # type: ignore
593
+ type_=typing.Any, # type: ignore
594
594
  object_=_response.json(),
595
595
  ),
596
596
  ),
@@ -599,9 +599,9 @@ class AsyncRawSafetyClient:
599
599
  raise NotFoundError(
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 AsyncRawSafetyClient:
610
610
  raise MethodNotAllowedError(
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 AsyncRawSafetyClient:
621
621
  raise TooManyRequestsError(
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 AsyncRawSafetyClient:
632
632
  raise InternalServerError(
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 AsyncRawSafetyClient:
643
643
  raise NotImplementedError(
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 AsyncRawSafetyClient:
654
654
  raise BadGatewayError(
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 AsyncRawSafetyClient:
665
665
  raise ServiceUnavailableError(
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 AsyncRawSafetyClient:
676
676
  raise GatewayTimeoutError(
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
  ),