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.
- samsara/__init__.py +84 -15
- samsara/addresses/client.py +7 -14
- samsara/addresses/raw_client.py +7 -11
- samsara/alerts/client.py +2 -10
- samsara/alerts/raw_client.py +180 -180
- samsara/assets/__init__.py +3 -3
- samsara/assets/client.py +14 -45
- samsara/assets/raw_client.py +156 -160
- samsara/assets/types/__init__.py +3 -3
- samsara/assets/types/{assets_list_request_type.py → list_assets_request_type.py} +1 -1
- samsara/attributes/client.py +0 -4
- samsara/beta_ap_is/client.py +139 -189
- samsara/beta_ap_is/raw_client.py +2035 -1702
- samsara/carrier_proposed_assignments/client.py +2 -10
- samsara/client.py +5 -0
- samsara/coaching/client.py +2 -22
- samsara/coaching/raw_client.py +108 -108
- samsara/contacts/client.py +2 -8
- samsara/core/__init__.py +5 -0
- samsara/core/client_wrapper.py +18 -10
- samsara/core/custom_pagination.py +152 -0
- samsara/core/http_client.py +176 -90
- samsara/core/http_sse/__init__.py +42 -0
- samsara/core/http_sse/_api.py +112 -0
- samsara/core/http_sse/_decoders.py +61 -0
- samsara/core/http_sse/_exceptions.py +7 -0
- samsara/core/http_sse/_models.py +17 -0
- samsara/core/pagination.py +14 -14
- samsara/core/pydantic_utilities.py +3 -1
- samsara/documents/client.py +2 -12
- samsara/documents/raw_client.py +180 -180
- samsara/driver_qr_codes/raw_client.py +108 -108
- samsara/driver_vehicle_assignments/client.py +0 -12
- samsara/driver_vehicle_assignments/raw_client.py +144 -144
- samsara/drivers/__init__.py +3 -3
- samsara/drivers/client.py +12 -23
- samsara/drivers/raw_client.py +48 -52
- samsara/drivers/types/__init__.py +3 -3
- samsara/drivers/types/{drivers_list_request_driver_activation_status.py → list_drivers_request_driver_activation_status.py} +1 -1
- samsara/equipment/client.py +6 -22
- samsara/errors/bad_gateway_error.py +1 -1
- samsara/errors/gateway_timeout_error.py +1 -1
- samsara/errors/internal_server_error.py +1 -1
- samsara/errors/method_not_allowed_error.py +1 -1
- samsara/errors/not_found_error.py +1 -1
- samsara/errors/not_implemented_error.py +1 -1
- samsara/errors/service_unavailable_error.py +1 -1
- samsara/errors/too_many_requests_error.py +1 -1
- samsara/errors/unauthorized_error.py +1 -1
- samsara/forms/__init__.py +9 -3
- samsara/forms/client.py +17 -10
- samsara/forms/raw_client.py +265 -254
- samsara/forms/types/__init__.py +6 -2
- samsara/forms/types/form_submissions_post_form_submission_request_body_status.py +5 -0
- samsara/fuel_and_energy/client.py +0 -30
- samsara/fuel_and_energy/raw_client.py +180 -180
- samsara/gateways/client.py +2 -6
- samsara/gateways/raw_client.py +108 -108
- samsara/hours_of_service/__init__.py +6 -3
- samsara/hours_of_service/client.py +13 -52
- samsara/hours_of_service/raw_client.py +77 -76
- samsara/hours_of_service/types/__init__.py +4 -2
- samsara/hours_of_service/types/get_hos_daily_logs_request_expand.py +5 -0
- samsara/hubs/client.py +2 -94
- samsara/hubs/raw_client.py +216 -216
- samsara/idling/client.py +10 -16
- samsara/idling/raw_client.py +46 -36
- samsara/ifta/client.py +4 -34
- samsara/ifta/raw_client.py +144 -144
- samsara/industrial/client.py +12 -56
- samsara/industrial/raw_client.py +40 -48
- samsara/issues/client.py +0 -4
- samsara/issues/raw_client.py +108 -108
- samsara/legacy_ap_is/client.py +4 -56
- samsara/legacy_ap_is/raw_client.py +108 -108
- samsara/live_sharing_links/client.py +2 -10
- samsara/live_sharing_links/raw_client.py +144 -144
- samsara/location_and_speed/client.py +2 -20
- samsara/location_and_speed/raw_client.py +36 -36
- samsara/maintenance/__init__.py +3 -3
- samsara/maintenance/client.py +15 -30
- samsara/maintenance/raw_client.py +191 -182
- samsara/maintenance/types/__init__.py +6 -2
- samsara/maintenance/types/create_dvir_request_type.py +5 -0
- samsara/media/client.py +2 -16
- samsara/media/raw_client.py +108 -108
- samsara/messages/client.py +2 -8
- samsara/plans/client.py +0 -21
- samsara/plans/raw_client.py +72 -72
- samsara/preview_ap_is/client.py +0 -140
- samsara/preview_ap_is/raw_client.py +72 -430
- samsara/route_events/client.py +2 -12
- samsara/route_events/raw_client.py +36 -36
- samsara/routes/__init__.py +30 -0
- samsara/routes/client.py +7 -35
- samsara/routes/raw_client.py +257 -256
- samsara/routes/types/__init__.py +34 -0
- samsara/routes/types/get_routes_feed_request_expand.py +5 -0
- samsara/safety/client.py +2 -10
- samsara/safety/raw_client.py +36 -36
- samsara/settings/raw_client.py +180 -180
- samsara/speeding_intervals/raw_client.py +36 -36
- samsara/tachograph_eu_only/client.py +0 -6
- samsara/tags/client.py +2 -8
- samsara/trailer_assignments/client.py +2 -18
- samsara/trailers/client.py +2 -12
- samsara/trailers/raw_client.py +180 -180
- samsara/types/__init__.py +71 -6
- samsara/types/advanced_idling_get_idling_events_response_body.py +2 -2
- samsara/types/create_routes_stop_request_object_request_body.py +7 -0
- samsara/types/driver_assignment_object_response_body.py +2 -1
- samsara/types/driver_assignment_object_response_body_assignment_type.py +5 -0
- samsara/types/driver_external_ids.py +1 -1
- samsara/types/forms_approval_config_object_response_body.py +2 -1
- samsara/types/forms_approval_config_object_response_body_type.py +5 -0
- samsara/types/fuel_level_trigger_details_object_request_body.py +2 -1
- samsara/types/fuel_level_trigger_details_object_request_body_operation.py +5 -0
- samsara/types/fuel_level_trigger_details_object_response_body.py +4 -1
- samsara/types/fuel_level_trigger_details_object_response_body_operation.py +5 -0
- samsara/types/harsh_event_trigger_details_object_request_body_types_item.py +1 -0
- samsara/types/harsh_event_trigger_details_object_response_body_types_item.py +1 -0
- samsara/types/idling_event_address_object_response_body.py +46 -0
- samsara/types/{idling_event_object_response_body_address_type.py → idling_event_address_object_response_body_address_types_item.py} +1 -1
- samsara/types/idling_event_asset_object_response_body.py +35 -0
- samsara/types/{idling_event_object_response_body.py → idling_event_object_v_20251023_response_body.py} +18 -28
- samsara/types/idling_event_object_v_20251023_response_body_pto_state.py +5 -0
- samsara/types/idling_event_operator_object_response_body.py +35 -0
- samsara/types/patch_issue_request_body_assigned_to_request_body.py +2 -1
- samsara/types/patch_issue_request_body_assigned_to_request_body_type.py +5 -0
- samsara/types/reading_datapoint_request_body.py +5 -4
- samsara/types/reading_datapoint_request_body_entity_type.py +5 -0
- samsara/types/reading_history_response_body.py +1 -1
- samsara/types/reading_snapshot_response_body.py +1 -1
- samsara/types/resolved_by.py +2 -1
- samsara/types/resolved_by_type.py +5 -0
- samsara/types/route_feed_object_response_body.py +2 -1
- samsara/types/route_feed_object_response_body_type.py +5 -0
- samsara/types/route_settings_request_body.py +8 -0
- samsara/types/route_settings_request_body_sequencing_method.py +7 -0
- samsara/types/route_settings_response_body.py +8 -0
- samsara/types/route_settings_response_body_sequencing_method.py +7 -0
- samsara/types/route_stop_details_object_response_body.py +2 -1
- samsara/types/route_stop_details_object_response_body_type.py +5 -0
- samsara/types/routes_stop_response_object_response_body.py +7 -0
- samsara/types/training_learner_object_response_body.py +2 -1
- samsara/types/training_learner_object_response_body_type.py +5 -0
- samsara/types/update_routes_stop_request_object_request_body.py +7 -0
- samsara/types/vehicle_assignment_object_response_body.py +4 -3
- samsara/types/vehicle_assignment_object_response_body_assignment_type.py +5 -0
- samsara/types/vehicle_external_ids.py +1 -1
- samsara/types/work_order_money_object_request_body.py +2 -1
- samsara/types/work_order_money_object_request_body_currency.py +5 -0
- samsara/types/work_order_money_object_response_body.py +2 -1
- samsara/types/work_order_money_object_response_body_currency.py +5 -0
- samsara/users/client.py +4 -16
- samsara/vehicle_locations/client.py +4 -16
- samsara/vehicles/client.py +7 -22
- samsara/vehicles/raw_client.py +43 -47
- samsara/webhooks/client.py +2 -10
- samsara/webhooks/raw_client.py +180 -180
- samsara/work_orders/client.py +4 -18
- samsara/work_orders/raw_client.py +216 -216
- {samsara_api-4.1.1.dist-info → samsara_api-4.3.0.dist-info}/METADATA +2 -1
- {samsara_api-4.1.1.dist-info → samsara_api-4.3.0.dist-info}/RECORD +166 -136
- {samsara_api-4.1.1.dist-info → samsara_api-4.3.0.dist-info}/LICENSE +0 -0
- {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"]
|
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())
|
samsara/safety/raw_client.py
CHANGED
|
@@ -167,9 +167,9 @@ class RawSafetyClient:
|
|
|
167
167
|
raise UnauthorizedError(
|
|
168
168
|
headers=dict(_response.headers),
|
|
169
169
|
body=typing.cast(
|
|
170
|
-
typing.
|
|
170
|
+
typing.Any,
|
|
171
171
|
parse_obj_as(
|
|
172
|
-
type_=typing.
|
|
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.
|
|
181
|
+
typing.Any,
|
|
182
182
|
parse_obj_as(
|
|
183
|
-
type_=typing.
|
|
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.
|
|
192
|
+
typing.Any,
|
|
193
193
|
parse_obj_as(
|
|
194
|
-
type_=typing.
|
|
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.
|
|
203
|
+
typing.Any,
|
|
204
204
|
parse_obj_as(
|
|
205
|
-
type_=typing.
|
|
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.
|
|
214
|
+
typing.Any,
|
|
215
215
|
parse_obj_as(
|
|
216
|
-
type_=typing.
|
|
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.
|
|
225
|
+
typing.Any,
|
|
226
226
|
parse_obj_as(
|
|
227
|
-
type_=typing.
|
|
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.
|
|
236
|
+
typing.Any,
|
|
237
237
|
parse_obj_as(
|
|
238
|
-
type_=typing.
|
|
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.
|
|
247
|
+
typing.Any,
|
|
248
248
|
parse_obj_as(
|
|
249
|
-
type_=typing.
|
|
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.
|
|
258
|
+
typing.Any,
|
|
259
259
|
parse_obj_as(
|
|
260
|
-
type_=typing.
|
|
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.
|
|
591
|
+
typing.Any,
|
|
592
592
|
parse_obj_as(
|
|
593
|
-
type_=typing.
|
|
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.
|
|
602
|
+
typing.Any,
|
|
603
603
|
parse_obj_as(
|
|
604
|
-
type_=typing.
|
|
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.
|
|
613
|
+
typing.Any,
|
|
614
614
|
parse_obj_as(
|
|
615
|
-
type_=typing.
|
|
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.
|
|
624
|
+
typing.Any,
|
|
625
625
|
parse_obj_as(
|
|
626
|
-
type_=typing.
|
|
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.
|
|
635
|
+
typing.Any,
|
|
636
636
|
parse_obj_as(
|
|
637
|
-
type_=typing.
|
|
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.
|
|
646
|
+
typing.Any,
|
|
647
647
|
parse_obj_as(
|
|
648
|
-
type_=typing.
|
|
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.
|
|
657
|
+
typing.Any,
|
|
658
658
|
parse_obj_as(
|
|
659
|
-
type_=typing.
|
|
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.
|
|
668
|
+
typing.Any,
|
|
669
669
|
parse_obj_as(
|
|
670
|
-
type_=typing.
|
|
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.
|
|
679
|
+
typing.Any,
|
|
680
680
|
parse_obj_as(
|
|
681
|
-
type_=typing.
|
|
681
|
+
type_=typing.Any, # type: ignore
|
|
682
682
|
object_=_response.json(),
|
|
683
683
|
),
|
|
684
684
|
),
|