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/forms/__init__.py
CHANGED
|
@@ -6,8 +6,14 @@ import typing
|
|
|
6
6
|
from importlib import import_module
|
|
7
7
|
|
|
8
8
|
if typing.TYPE_CHECKING:
|
|
9
|
-
from .types import
|
|
10
|
-
|
|
9
|
+
from .types import (
|
|
10
|
+
FormSubmissionsPatchFormSubmissionRequestBodyStatus,
|
|
11
|
+
FormSubmissionsPostFormSubmissionRequestBodyStatus,
|
|
12
|
+
)
|
|
13
|
+
_dynamic_imports: typing.Dict[str, str] = {
|
|
14
|
+
"FormSubmissionsPatchFormSubmissionRequestBodyStatus": ".types",
|
|
15
|
+
"FormSubmissionsPostFormSubmissionRequestBodyStatus": ".types",
|
|
16
|
+
}
|
|
11
17
|
|
|
12
18
|
|
|
13
19
|
def __getattr__(attr_name: str) -> typing.Any:
|
|
@@ -31,4 +37,4 @@ def __dir__():
|
|
|
31
37
|
return sorted(lazy_attrs)
|
|
32
38
|
|
|
33
39
|
|
|
34
|
-
__all__ = ["FormSubmissionsPatchFormSubmissionRequestBodyStatus"]
|
|
40
|
+
__all__ = ["FormSubmissionsPatchFormSubmissionRequestBodyStatus", "FormSubmissionsPostFormSubmissionRequestBodyStatus"]
|
samsara/forms/client.py
CHANGED
|
@@ -30,6 +30,9 @@ from .raw_client import AsyncRawFormsClient, RawFormsClient
|
|
|
30
30
|
from .types.form_submissions_patch_form_submission_request_body_status import (
|
|
31
31
|
FormSubmissionsPatchFormSubmissionRequestBodyStatus,
|
|
32
32
|
)
|
|
33
|
+
from .types.form_submissions_post_form_submission_request_body_status import (
|
|
34
|
+
FormSubmissionsPostFormSubmissionRequestBodyStatus,
|
|
35
|
+
)
|
|
33
36
|
|
|
34
37
|
# this is used as the default value for optional parameters
|
|
35
38
|
OMIT = typing.cast(typing.Any, ...)
|
|
@@ -99,6 +102,7 @@ class FormsClient:
|
|
|
99
102
|
self,
|
|
100
103
|
*,
|
|
101
104
|
form_template: FormTemplateRequestObjectRequestBody,
|
|
105
|
+
status: FormSubmissionsPostFormSubmissionRequestBodyStatus,
|
|
102
106
|
assigned_to: typing.Optional[FormSubmissionRequestAssignedToRequestBody] = OMIT,
|
|
103
107
|
due_at_time: typing.Optional[dt.datetime] = OMIT,
|
|
104
108
|
fields: typing.Optional[typing.Sequence[FormSubmissionRequestFieldInputObjectRequestBody]] = OMIT,
|
|
@@ -121,6 +125,9 @@ class FormsClient:
|
|
|
121
125
|
----------
|
|
122
126
|
form_template : FormTemplateRequestObjectRequestBody
|
|
123
127
|
|
|
128
|
+
status : FormSubmissionsPostFormSubmissionRequestBodyStatus
|
|
129
|
+
Status of the form submission. Valid values: `notStarted`
|
|
130
|
+
|
|
124
131
|
assigned_to : typing.Optional[FormSubmissionRequestAssignedToRequestBody]
|
|
125
132
|
|
|
126
133
|
due_at_time : typing.Optional[dt.datetime]
|
|
@@ -158,10 +165,12 @@ class FormsClient:
|
|
|
158
165
|
id="9814a1fa-f0c6-408b-bf85-51dc3bc71ac7",
|
|
159
166
|
revision_id="1214a1fa-f0c6-408b-bf85-51dc3bc71ac7",
|
|
160
167
|
),
|
|
168
|
+
status="notStarted",
|
|
161
169
|
)
|
|
162
170
|
"""
|
|
163
171
|
_response = self._raw_client.post_form_submission(
|
|
164
172
|
form_template=form_template,
|
|
173
|
+
status=status,
|
|
165
174
|
assigned_to=assigned_to,
|
|
166
175
|
due_at_time=due_at_time,
|
|
167
176
|
fields=fields,
|
|
@@ -398,8 +407,6 @@ class FormsClient:
|
|
|
398
407
|
)
|
|
399
408
|
client.forms.get_form_submissions_stream(
|
|
400
409
|
start_time="startTime",
|
|
401
|
-
end_time="endTime",
|
|
402
|
-
after="after",
|
|
403
410
|
)
|
|
404
411
|
"""
|
|
405
412
|
_response = self._raw_client.get_form_submissions_stream(
|
|
@@ -455,9 +462,7 @@ class FormsClient:
|
|
|
455
462
|
client = Samsara(
|
|
456
463
|
token="YOUR_TOKEN",
|
|
457
464
|
)
|
|
458
|
-
client.forms.get_form_templates(
|
|
459
|
-
after="after",
|
|
460
|
-
)
|
|
465
|
+
client.forms.get_form_templates()
|
|
461
466
|
"""
|
|
462
467
|
_response = self._raw_client.get_form_templates(ids=ids, after=after, request_options=request_options)
|
|
463
468
|
return _response.data
|
|
@@ -537,6 +542,7 @@ class AsyncFormsClient:
|
|
|
537
542
|
self,
|
|
538
543
|
*,
|
|
539
544
|
form_template: FormTemplateRequestObjectRequestBody,
|
|
545
|
+
status: FormSubmissionsPostFormSubmissionRequestBodyStatus,
|
|
540
546
|
assigned_to: typing.Optional[FormSubmissionRequestAssignedToRequestBody] = OMIT,
|
|
541
547
|
due_at_time: typing.Optional[dt.datetime] = OMIT,
|
|
542
548
|
fields: typing.Optional[typing.Sequence[FormSubmissionRequestFieldInputObjectRequestBody]] = OMIT,
|
|
@@ -559,6 +565,9 @@ class AsyncFormsClient:
|
|
|
559
565
|
----------
|
|
560
566
|
form_template : FormTemplateRequestObjectRequestBody
|
|
561
567
|
|
|
568
|
+
status : FormSubmissionsPostFormSubmissionRequestBodyStatus
|
|
569
|
+
Status of the form submission. Valid values: `notStarted`
|
|
570
|
+
|
|
562
571
|
assigned_to : typing.Optional[FormSubmissionRequestAssignedToRequestBody]
|
|
563
572
|
|
|
564
573
|
due_at_time : typing.Optional[dt.datetime]
|
|
@@ -601,6 +610,7 @@ class AsyncFormsClient:
|
|
|
601
610
|
id="9814a1fa-f0c6-408b-bf85-51dc3bc71ac7",
|
|
602
611
|
revision_id="1214a1fa-f0c6-408b-bf85-51dc3bc71ac7",
|
|
603
612
|
),
|
|
613
|
+
status="notStarted",
|
|
604
614
|
)
|
|
605
615
|
|
|
606
616
|
|
|
@@ -608,6 +618,7 @@ class AsyncFormsClient:
|
|
|
608
618
|
"""
|
|
609
619
|
_response = await self._raw_client.post_form_submission(
|
|
610
620
|
form_template=form_template,
|
|
621
|
+
status=status,
|
|
611
622
|
assigned_to=assigned_to,
|
|
612
623
|
due_at_time=due_at_time,
|
|
613
624
|
fields=fields,
|
|
@@ -875,8 +886,6 @@ class AsyncFormsClient:
|
|
|
875
886
|
async def main() -> None:
|
|
876
887
|
await client.forms.get_form_submissions_stream(
|
|
877
888
|
start_time="startTime",
|
|
878
|
-
end_time="endTime",
|
|
879
|
-
after="after",
|
|
880
889
|
)
|
|
881
890
|
|
|
882
891
|
|
|
@@ -940,9 +949,7 @@ class AsyncFormsClient:
|
|
|
940
949
|
|
|
941
950
|
|
|
942
951
|
async def main() -> None:
|
|
943
|
-
await client.forms.get_form_templates(
|
|
944
|
-
after="after",
|
|
945
|
-
)
|
|
952
|
+
await client.forms.get_form_templates()
|
|
946
953
|
|
|
947
954
|
|
|
948
955
|
asyncio.run(main())
|