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
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
|
|
samsara/plans/raw_client.py
CHANGED
|
@@ -86,9 +86,9 @@ class RawPlansClient:
|
|
|
86
86
|
raise UnauthorizedError(
|
|
87
87
|
headers=dict(_response.headers),
|
|
88
88
|
body=typing.cast(
|
|
89
|
-
typing.
|
|
89
|
+
typing.Any,
|
|
90
90
|
parse_obj_as(
|
|
91
|
-
type_=typing.
|
|
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.
|
|
100
|
+
typing.Any,
|
|
101
101
|
parse_obj_as(
|
|
102
|
-
type_=typing.
|
|
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.
|
|
111
|
+
typing.Any,
|
|
112
112
|
parse_obj_as(
|
|
113
|
-
type_=typing.
|
|
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.
|
|
122
|
+
typing.Any,
|
|
123
123
|
parse_obj_as(
|
|
124
|
-
type_=typing.
|
|
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.
|
|
133
|
+
typing.Any,
|
|
134
134
|
parse_obj_as(
|
|
135
|
-
type_=typing.
|
|
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.
|
|
144
|
+
typing.Any,
|
|
145
145
|
parse_obj_as(
|
|
146
|
-
type_=typing.
|
|
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.
|
|
155
|
+
typing.Any,
|
|
156
156
|
parse_obj_as(
|
|
157
|
-
type_=typing.
|
|
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.
|
|
166
|
+
typing.Any,
|
|
167
167
|
parse_obj_as(
|
|
168
|
-
type_=typing.
|
|
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.
|
|
177
|
+
typing.Any,
|
|
178
178
|
parse_obj_as(
|
|
179
|
-
type_=typing.
|
|
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.
|
|
265
|
+
typing.Any,
|
|
266
266
|
parse_obj_as(
|
|
267
|
-
type_=typing.
|
|
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.
|
|
276
|
+
typing.Any,
|
|
277
277
|
parse_obj_as(
|
|
278
|
-
type_=typing.
|
|
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.
|
|
287
|
+
typing.Any,
|
|
288
288
|
parse_obj_as(
|
|
289
|
-
type_=typing.
|
|
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.
|
|
298
|
+
typing.Any,
|
|
299
299
|
parse_obj_as(
|
|
300
|
-
type_=typing.
|
|
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.
|
|
309
|
+
typing.Any,
|
|
310
310
|
parse_obj_as(
|
|
311
|
-
type_=typing.
|
|
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.
|
|
320
|
+
typing.Any,
|
|
321
321
|
parse_obj_as(
|
|
322
|
-
type_=typing.
|
|
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.
|
|
331
|
+
typing.Any,
|
|
332
332
|
parse_obj_as(
|
|
333
|
-
type_=typing.
|
|
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.
|
|
342
|
+
typing.Any,
|
|
343
343
|
parse_obj_as(
|
|
344
|
-
type_=typing.
|
|
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.
|
|
353
|
+
typing.Any,
|
|
354
354
|
parse_obj_as(
|
|
355
|
-
type_=typing.
|
|
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.
|
|
426
|
+
typing.Any,
|
|
427
427
|
parse_obj_as(
|
|
428
|
-
type_=typing.
|
|
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.
|
|
437
|
+
typing.Any,
|
|
438
438
|
parse_obj_as(
|
|
439
|
-
type_=typing.
|
|
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.
|
|
448
|
+
typing.Any,
|
|
449
449
|
parse_obj_as(
|
|
450
|
-
type_=typing.
|
|
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.
|
|
459
|
+
typing.Any,
|
|
460
460
|
parse_obj_as(
|
|
461
|
-
type_=typing.
|
|
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.
|
|
470
|
+
typing.Any,
|
|
471
471
|
parse_obj_as(
|
|
472
|
-
type_=typing.
|
|
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.
|
|
481
|
+
typing.Any,
|
|
482
482
|
parse_obj_as(
|
|
483
|
-
type_=typing.
|
|
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.
|
|
492
|
+
typing.Any,
|
|
493
493
|
parse_obj_as(
|
|
494
|
-
type_=typing.
|
|
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.
|
|
503
|
+
typing.Any,
|
|
504
504
|
parse_obj_as(
|
|
505
|
-
type_=typing.
|
|
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.
|
|
514
|
+
typing.Any,
|
|
515
515
|
parse_obj_as(
|
|
516
|
-
type_=typing.
|
|
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.
|
|
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 AsyncRawPlansClient:
|
|
|
610
610
|
raise NotFoundError(
|
|
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 AsyncRawPlansClient:
|
|
|
621
621
|
raise MethodNotAllowedError(
|
|
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 AsyncRawPlansClient:
|
|
|
632
632
|
raise TooManyRequestsError(
|
|
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 AsyncRawPlansClient:
|
|
|
643
643
|
raise InternalServerError(
|
|
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 AsyncRawPlansClient:
|
|
|
654
654
|
raise NotImplementedError(
|
|
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 AsyncRawPlansClient:
|
|
|
665
665
|
raise BadGatewayError(
|
|
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 AsyncRawPlansClient:
|
|
|
676
676
|
raise ServiceUnavailableError(
|
|
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
|
),
|
|
@@ -687,9 +687,9 @@ class AsyncRawPlansClient:
|
|
|
687
687
|
raise GatewayTimeoutError(
|
|
688
688
|
headers=dict(_response.headers),
|
|
689
689
|
body=typing.cast(
|
|
690
|
-
typing.
|
|
690
|
+
typing.Any,
|
|
691
691
|
parse_obj_as(
|
|
692
|
-
type_=typing.
|
|
692
|
+
type_=typing.Any, # type: ignore
|
|
693
693
|
object_=_response.json(),
|
|
694
694
|
),
|
|
695
695
|
),
|
samsara/preview_ap_is/client.py
CHANGED
|
@@ -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.
|