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
|
@@ -8,28 +8,18 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
|
8
8
|
from ..core.serialization import FieldMetadata
|
|
9
9
|
from .fuel_cost_object_response_body import FuelCostObjectResponseBody
|
|
10
10
|
from .gaseous_fuel_cost_object_response_body import GaseousFuelCostObjectResponseBody
|
|
11
|
-
from .
|
|
11
|
+
from .idling_event_address_object_response_body import IdlingEventAddressObjectResponseBody
|
|
12
|
+
from .idling_event_asset_object_response_body import IdlingEventAssetObjectResponseBody
|
|
13
|
+
from .idling_event_object_v_20251023_response_body_pto_state import IdlingEventObjectV20251023ResponseBodyPtoState
|
|
14
|
+
from .idling_event_operator_object_response_body import IdlingEventOperatorObjectResponseBody
|
|
12
15
|
|
|
13
16
|
|
|
14
|
-
class
|
|
17
|
+
class IdlingEventObjectV20251023ResponseBody(UniversalBaseModel):
|
|
15
18
|
"""
|
|
16
19
|
An idling event object.
|
|
17
20
|
"""
|
|
18
21
|
|
|
19
|
-
|
|
20
|
-
default=None
|
|
21
|
-
)
|
|
22
|
-
"""
|
|
23
|
-
The ID of the geofence address of the idling location, if applicable. It will be the address at the time of idling.
|
|
24
|
-
"""
|
|
25
|
-
|
|
26
|
-
address_type: typing_extensions.Annotated[
|
|
27
|
-
typing.Optional[IdlingEventObjectResponseBodyAddressType], FieldMetadata(alias="addressType")
|
|
28
|
-
] = pydantic.Field(default=None)
|
|
29
|
-
"""
|
|
30
|
-
The type of the geofence address of the idling location, if applicable. Valid values: `agricultureSource`, `alertsOnly`, `avoidanceZone`, `industrialSite`, `knownGPSJammingZone`, `riskZone`, `shortHaul`, `undefined`, `workforceSite`, `yard`
|
|
31
|
-
"""
|
|
32
|
-
|
|
22
|
+
address: typing.Optional[IdlingEventAddressObjectResponseBody] = None
|
|
33
23
|
air_temperature_millicelsius: typing_extensions.Annotated[
|
|
34
24
|
typing.Optional[int], FieldMetadata(alias="airTemperatureMillicelsius")
|
|
35
25
|
] = pydantic.Field(default=None)
|
|
@@ -37,11 +27,7 @@ class IdlingEventObjectResponseBody(UniversalBaseModel):
|
|
|
37
27
|
The air temperature in millicelsius during the idling event. Value is returned only when it is known.
|
|
38
28
|
"""
|
|
39
29
|
|
|
40
|
-
|
|
41
|
-
"""
|
|
42
|
-
Samsara ID of the asset assigned to the event. Returns vehicle ID at this time.
|
|
43
|
-
"""
|
|
44
|
-
|
|
30
|
+
asset: IdlingEventAssetObjectResponseBody
|
|
45
31
|
duration_milliseconds: typing_extensions.Annotated[int, FieldMetadata(alias="durationMilliseconds")] = (
|
|
46
32
|
pydantic.Field()
|
|
47
33
|
)
|
|
@@ -72,16 +58,20 @@ class IdlingEventObjectResponseBody(UniversalBaseModel):
|
|
|
72
58
|
gaseous_fuel_cost: typing_extensions.Annotated[
|
|
73
59
|
GaseousFuelCostObjectResponseBody, FieldMetadata(alias="gaseousFuelCost")
|
|
74
60
|
]
|
|
75
|
-
|
|
76
|
-
default=None
|
|
77
|
-
)
|
|
61
|
+
latitude: typing.Optional[float] = pydantic.Field(default=None)
|
|
78
62
|
"""
|
|
79
|
-
|
|
63
|
+
The latitude of the location where the idling event occurred.
|
|
80
64
|
"""
|
|
81
65
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
66
|
+
longitude: typing.Optional[float] = pydantic.Field(default=None)
|
|
67
|
+
"""
|
|
68
|
+
The longitude of the location where the idling event occurred.
|
|
69
|
+
"""
|
|
70
|
+
|
|
71
|
+
operator: typing.Optional[IdlingEventOperatorObjectResponseBody] = None
|
|
72
|
+
pto_state: typing_extensions.Annotated[
|
|
73
|
+
IdlingEventObjectV20251023ResponseBodyPtoState, FieldMetadata(alias="ptoState")
|
|
74
|
+
] = pydantic.Field()
|
|
85
75
|
"""
|
|
86
76
|
The PTO (Power Take-Off) state during the idling event. Valid values: `active, inactive`
|
|
87
77
|
"""
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
import typing_extensions
|
|
7
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
8
|
+
from ..core.serialization import FieldMetadata
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class IdlingEventOperatorObjectResponseBody(UniversalBaseModel):
|
|
12
|
+
"""
|
|
13
|
+
The operator associated with the idling event. Returns driver details at this time. Value is returned when a driver is assigned to the vehicle
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
external_ids: typing_extensions.Annotated[
|
|
17
|
+
typing.Optional[typing.Dict[str, str]], FieldMetadata(alias="externalIds")
|
|
18
|
+
] = pydantic.Field(default=None)
|
|
19
|
+
"""
|
|
20
|
+
A map of external ids for the operator.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
id: int = pydantic.Field()
|
|
24
|
+
"""
|
|
25
|
+
Samsara ID of the operator assigned to the event. Returns driver ID at this time.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
if IS_PYDANTIC_V2:
|
|
29
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
30
|
+
else:
|
|
31
|
+
|
|
32
|
+
class Config:
|
|
33
|
+
frozen = True
|
|
34
|
+
smart_union = True
|
|
35
|
+
extra = pydantic.Extra.allow
|
|
@@ -4,6 +4,7 @@ import typing
|
|
|
4
4
|
|
|
5
5
|
import pydantic
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
+
from .patch_issue_request_body_assigned_to_request_body_type import PatchIssueRequestBodyAssignedToRequestBodyType
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
class PatchIssueRequestBodyAssignedToRequestBody(UniversalBaseModel):
|
|
@@ -16,7 +17,7 @@ class PatchIssueRequestBodyAssignedToRequestBody(UniversalBaseModel):
|
|
|
16
17
|
ID of the issue assignee.
|
|
17
18
|
"""
|
|
18
19
|
|
|
19
|
-
type:
|
|
20
|
+
type: PatchIssueRequestBodyAssignedToRequestBodyType = pydantic.Field()
|
|
20
21
|
"""
|
|
21
22
|
Type of the issue assignee. Valid values: `user`
|
|
22
23
|
"""
|
|
@@ -6,6 +6,7 @@ import pydantic
|
|
|
6
6
|
import typing_extensions
|
|
7
7
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
8
8
|
from ..core.serialization import FieldMetadata
|
|
9
|
+
from .reading_datapoint_request_body_entity_type import ReadingDatapointRequestBodyEntityType
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
class ReadingDatapointRequestBody(UniversalBaseModel):
|
|
@@ -18,9 +19,9 @@ class ReadingDatapointRequestBody(UniversalBaseModel):
|
|
|
18
19
|
Samsara entity ID. In case of an asset, it’s the assetId. If the asset is not yet present in the system, it is required to create a new one via the /assets endpoint.
|
|
19
20
|
"""
|
|
20
21
|
|
|
21
|
-
entity_type: typing_extensions.Annotated[
|
|
22
|
-
|
|
23
|
-
)
|
|
22
|
+
entity_type: typing_extensions.Annotated[
|
|
23
|
+
ReadingDatapointRequestBodyEntityType, FieldMetadata(alias="entityType")
|
|
24
|
+
] = pydantic.Field()
|
|
24
25
|
"""
|
|
25
26
|
The type of the entity (e.g., asset). Valid values: `asset`
|
|
26
27
|
"""
|
|
@@ -35,7 +36,7 @@ class ReadingDatapointRequestBody(UniversalBaseModel):
|
|
|
35
36
|
The ID of the reading, you can get it from the /readings/definitions endpoint.
|
|
36
37
|
"""
|
|
37
38
|
|
|
38
|
-
value: typing.Dict[str, typing.
|
|
39
|
+
value: typing.Dict[str, typing.Any] = pydantic.Field()
|
|
39
40
|
"""
|
|
40
41
|
The value of the reading. Can be any object. See the /readings/definitions endpoint for the value type for each reading.
|
|
41
42
|
"""
|
|
@@ -32,7 +32,7 @@ class ReadingHistoryResponseBody(UniversalBaseModel):
|
|
|
32
32
|
The time in RFC 3339 format when the reading was measured.
|
|
33
33
|
"""
|
|
34
34
|
|
|
35
|
-
value: typing.Optional[typing.Dict[str, typing.
|
|
35
|
+
value: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
|
|
36
36
|
"""
|
|
37
37
|
The value of the reading.
|
|
38
38
|
"""
|
|
@@ -37,7 +37,7 @@ class ReadingSnapshotResponseBody(UniversalBaseModel):
|
|
|
37
37
|
The ID of the reading for which the data is being returned.
|
|
38
38
|
"""
|
|
39
39
|
|
|
40
|
-
value: typing.Optional[typing.Dict[str, typing.
|
|
40
|
+
value: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
|
|
41
41
|
"""
|
|
42
42
|
The value of the reading.
|
|
43
43
|
"""
|
samsara/types/resolved_by.py
CHANGED
|
@@ -4,6 +4,7 @@ import typing
|
|
|
4
4
|
|
|
5
5
|
import pydantic
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
+
from .resolved_by_type import ResolvedByType
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
class ResolvedBy(UniversalBaseModel):
|
|
@@ -16,7 +17,7 @@ class ResolvedBy(UniversalBaseModel):
|
|
|
16
17
|
The Id of user who is resolving the defect.
|
|
17
18
|
"""
|
|
18
19
|
|
|
19
|
-
type:
|
|
20
|
+
type: ResolvedByType = pydantic.Field()
|
|
20
21
|
"""
|
|
21
22
|
The type of user who is resolving the defect. Must be "mechanic".
|
|
22
23
|
"""
|
|
@@ -9,6 +9,7 @@ from .base_route_response_object_response_body import BaseRouteResponseObjectRes
|
|
|
9
9
|
from .route_changes_response_body import RouteChangesResponseBody
|
|
10
10
|
from .route_feed_object_response_body_operation import RouteFeedObjectResponseBodyOperation
|
|
11
11
|
from .route_feed_object_response_body_source import RouteFeedObjectResponseBodySource
|
|
12
|
+
from .route_feed_object_response_body_type import RouteFeedObjectResponseBodyType
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
class RouteFeedObjectResponseBody(UniversalBaseModel):
|
|
@@ -33,7 +34,7 @@ class RouteFeedObjectResponseBody(UniversalBaseModel):
|
|
|
33
34
|
The timestamp of the route in RFC 3339 format.
|
|
34
35
|
"""
|
|
35
36
|
|
|
36
|
-
type:
|
|
37
|
+
type: RouteFeedObjectResponseBodyType = pydantic.Field()
|
|
37
38
|
"""
|
|
38
39
|
The type of route update. The route tracking updates occur as a route is completed and stops transition from one state to another. Currently only Route Tracking updates are supported, but this will change in the future when additional types are added. Valid values: `route tracking`
|
|
39
40
|
"""
|
|
@@ -8,6 +8,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
|
8
8
|
from ..core.serialization import FieldMetadata
|
|
9
9
|
from .route_settings_request_body_route_completion_condition import RouteSettingsRequestBodyRouteCompletionCondition
|
|
10
10
|
from .route_settings_request_body_route_starting_condition import RouteSettingsRequestBodyRouteStartingCondition
|
|
11
|
+
from .route_settings_request_body_sequencing_method import RouteSettingsRequestBodySequencingMethod
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
class RouteSettingsRequestBody(UniversalBaseModel):
|
|
@@ -33,6 +34,13 @@ class RouteSettingsRequestBody(UniversalBaseModel):
|
|
|
33
34
|
the arrival time of the first stop should not be set. Valid values: `departFirstStop`, `arriveFirstStop`
|
|
34
35
|
"""
|
|
35
36
|
|
|
37
|
+
sequencing_method: typing_extensions.Annotated[
|
|
38
|
+
typing.Optional[RouteSettingsRequestBodySequencingMethod], FieldMetadata(alias="sequencingMethod")
|
|
39
|
+
] = pydantic.Field(default=None)
|
|
40
|
+
"""
|
|
41
|
+
Determines how stops are sequenced on the route. 'scheduledArrivalTime' sequences stops by their scheduled arrival times (default). 'manual' allows custom sequencing via stop.sequenceNumber. 'unknown' indicates the method is not specified. Valid values: `unknown`, `scheduledArrivalTime`, `manual`
|
|
42
|
+
"""
|
|
43
|
+
|
|
36
44
|
if IS_PYDANTIC_V2:
|
|
37
45
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
38
46
|
else:
|
|
@@ -8,6 +8,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
|
8
8
|
from ..core.serialization import FieldMetadata
|
|
9
9
|
from .route_settings_response_body_route_completion_condition import RouteSettingsResponseBodyRouteCompletionCondition
|
|
10
10
|
from .route_settings_response_body_route_starting_condition import RouteSettingsResponseBodyRouteStartingCondition
|
|
11
|
+
from .route_settings_response_body_sequencing_method import RouteSettingsResponseBodySequencingMethod
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
class RouteSettingsResponseBody(UniversalBaseModel):
|
|
@@ -33,6 +34,13 @@ class RouteSettingsResponseBody(UniversalBaseModel):
|
|
|
33
34
|
the arrival time of the first stop should not be set. Valid values: `departFirstStop`, `arriveFirstStop`
|
|
34
35
|
"""
|
|
35
36
|
|
|
37
|
+
sequencing_method: typing_extensions.Annotated[
|
|
38
|
+
typing.Optional[RouteSettingsResponseBodySequencingMethod], FieldMetadata(alias="sequencingMethod")
|
|
39
|
+
] = pydantic.Field(default=None)
|
|
40
|
+
"""
|
|
41
|
+
Determines how stops are sequenced on the route. 'scheduledArrivalTime' sequences stops by their scheduled arrival times (default). 'manual' allows custom sequencing via stop.sequenceNumber. 'unknown' indicates the method is not specified. Valid values: `unknown`, `scheduledArrivalTime`, `manual`
|
|
42
|
+
"""
|
|
43
|
+
|
|
36
44
|
if IS_PYDANTIC_V2:
|
|
37
45
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
38
46
|
else:
|
|
@@ -10,6 +10,7 @@ from ..core.serialization import FieldMetadata
|
|
|
10
10
|
from .goa_driver_tiny_response_response_body import GoaDriverTinyResponseResponseBody
|
|
11
11
|
from .minimal_route_stop_response_body import MinimalRouteStopResponseBody
|
|
12
12
|
from .route_stop_details_object_response_body_operation import RouteStopDetailsObjectResponseBodyOperation
|
|
13
|
+
from .route_stop_details_object_response_body_type import RouteStopDetailsObjectResponseBodyType
|
|
13
14
|
from .vehicle_with_gateway_tiny_response_response_body import VehicleWithGatewayTinyResponseResponseBody
|
|
14
15
|
from .webhook_route_response_object_response_body import WebhookRouteResponseObjectResponseBody
|
|
15
16
|
|
|
@@ -30,7 +31,7 @@ class RouteStopDetailsObjectResponseBody(UniversalBaseModel):
|
|
|
30
31
|
The timestamp of the route in RFC 3339 format.
|
|
31
32
|
"""
|
|
32
33
|
|
|
33
|
-
type:
|
|
34
|
+
type: RouteStopDetailsObjectResponseBodyType = pydantic.Field()
|
|
34
35
|
"""
|
|
35
36
|
The type of route update. The route tracking updates occur as a route is completed and stops transition from one state to another. Currently only Route Tracking updates are supported, but this will change in the future when additional types are added. Valid values: `route tracking`
|
|
36
37
|
"""
|
|
@@ -124,6 +124,13 @@ class RoutesStopResponseObjectResponseBody(UniversalBaseModel):
|
|
|
124
124
|
Scheduled departure time, if it exists, for the stop in RFC 3339 format.
|
|
125
125
|
"""
|
|
126
126
|
|
|
127
|
+
sequence_number: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="sequenceNumber")] = (
|
|
128
|
+
pydantic.Field(default=None)
|
|
129
|
+
)
|
|
130
|
+
"""
|
|
131
|
+
Manual sequence position of this stop. Only used when route.settings.sequencingMethod=manual.
|
|
132
|
+
"""
|
|
133
|
+
|
|
127
134
|
single_use_location: typing_extensions.Annotated[
|
|
128
135
|
typing.Optional[RoutesSingleUseAddressObjectResponseBody], FieldMetadata(alias="singleUseLocation")
|
|
129
136
|
] = None
|
|
@@ -4,6 +4,7 @@ import typing
|
|
|
4
4
|
|
|
5
5
|
import pydantic
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
+
from .training_learner_object_response_body_type import TrainingLearnerObjectResponseBodyType
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
class TrainingLearnerObjectResponseBody(UniversalBaseModel):
|
|
@@ -16,7 +17,7 @@ class TrainingLearnerObjectResponseBody(UniversalBaseModel):
|
|
|
16
17
|
ID of the polymorphic user.
|
|
17
18
|
"""
|
|
18
19
|
|
|
19
|
-
type:
|
|
20
|
+
type: TrainingLearnerObjectResponseBodyType = pydantic.Field()
|
|
20
21
|
"""
|
|
21
22
|
The type of the polymorphic user. Valid values: `driver`
|
|
22
23
|
"""
|
|
@@ -68,6 +68,13 @@ class UpdateRoutesStopRequestObjectRequestBody(UniversalBaseModel):
|
|
|
68
68
|
This is a required field for all stops EXCEPT the start and end, based on route start and stop settings selected.
|
|
69
69
|
"""
|
|
70
70
|
|
|
71
|
+
sequence_number: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="sequenceNumber")] = (
|
|
72
|
+
pydantic.Field(default=None)
|
|
73
|
+
)
|
|
74
|
+
"""
|
|
75
|
+
Manual sequence position for this stop. Only meaningful when route.settings.sequencingMethod=manual. Must be unique and positive when specified.
|
|
76
|
+
"""
|
|
77
|
+
|
|
71
78
|
single_use_location: typing_extensions.Annotated[
|
|
72
79
|
typing.Optional[RoutesSingleUseAddressObjectRequestBody], FieldMetadata(alias="singleUseLocation")
|
|
73
80
|
] = None
|
|
@@ -7,12 +7,13 @@ import typing_extensions
|
|
|
7
7
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
8
8
|
from ..core.serialization import FieldMetadata
|
|
9
9
|
from .goa_vehicle_tiny_response_response_body import GoaVehicleTinyResponseResponseBody
|
|
10
|
+
from .vehicle_assignment_object_response_body_assignment_type import VehicleAssignmentObjectResponseBodyAssignmentType
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
class VehicleAssignmentObjectResponseBody(UniversalBaseModel):
|
|
13
|
-
assignment_type: typing_extensions.Annotated[
|
|
14
|
-
|
|
15
|
-
)
|
|
14
|
+
assignment_type: typing_extensions.Annotated[
|
|
15
|
+
VehicleAssignmentObjectResponseBodyAssignmentType, FieldMetadata(alias="assignmentType")
|
|
16
|
+
] = pydantic.Field()
|
|
16
17
|
"""
|
|
17
18
|
Assignment type of the driver-vehicle assignment, indicating the provenance of the assignment. The only type of assignment supported right now is `driverApp` assignments. This list could change, so it is recommended that clients gracefully handle any types not enumerated in this list. Valid values: `driverApp`
|
|
18
19
|
"""
|
|
@@ -4,6 +4,7 @@ import typing
|
|
|
4
4
|
|
|
5
5
|
import pydantic
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
+
from .work_order_money_object_request_body_currency import WorkOrderMoneyObjectRequestBodyCurrency
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
class WorkOrderMoneyObjectRequestBody(UniversalBaseModel):
|
|
@@ -16,7 +17,7 @@ class WorkOrderMoneyObjectRequestBody(UniversalBaseModel):
|
|
|
16
17
|
Amount of the currency.
|
|
17
18
|
"""
|
|
18
19
|
|
|
19
|
-
currency:
|
|
20
|
+
currency: WorkOrderMoneyObjectRequestBodyCurrency = pydantic.Field()
|
|
20
21
|
"""
|
|
21
22
|
Type of the currency. We currently only support usd. Valid values: `usd`
|
|
22
23
|
"""
|
|
@@ -4,6 +4,7 @@ import typing
|
|
|
4
4
|
|
|
5
5
|
import pydantic
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
+
from .work_order_money_object_response_body_currency import WorkOrderMoneyObjectResponseBodyCurrency
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
class WorkOrderMoneyObjectResponseBody(UniversalBaseModel):
|
|
@@ -16,7 +17,7 @@ class WorkOrderMoneyObjectResponseBody(UniversalBaseModel):
|
|
|
16
17
|
Amount of the currency.
|
|
17
18
|
"""
|
|
18
19
|
|
|
19
|
-
currency:
|
|
20
|
+
currency: WorkOrderMoneyObjectResponseBodyCurrency = pydantic.Field()
|
|
20
21
|
"""
|
|
21
22
|
Type of the currency. We currently only support usd. Valid values: `usd`
|
|
22
23
|
"""
|
samsara/users/client.py
CHANGED
|
@@ -69,10 +69,7 @@ class UsersClient:
|
|
|
69
69
|
client = Samsara(
|
|
70
70
|
token="YOUR_TOKEN",
|
|
71
71
|
)
|
|
72
|
-
client.users.list_user_roles(
|
|
73
|
-
limit=1000000,
|
|
74
|
-
after="after",
|
|
75
|
-
)
|
|
72
|
+
client.users.list_user_roles()
|
|
76
73
|
"""
|
|
77
74
|
_response = self._raw_client.list_user_roles(limit=limit, after=after, request_options=request_options)
|
|
78
75
|
return _response.data
|
|
@@ -114,10 +111,7 @@ class UsersClient:
|
|
|
114
111
|
client = Samsara(
|
|
115
112
|
token="YOUR_TOKEN",
|
|
116
113
|
)
|
|
117
|
-
client.users.list_users(
|
|
118
|
-
limit=1000000,
|
|
119
|
-
after="after",
|
|
120
|
-
)
|
|
114
|
+
client.users.list_users()
|
|
121
115
|
"""
|
|
122
116
|
_response = self._raw_client.list_users(limit=limit, after=after, request_options=request_options)
|
|
123
117
|
return _response.data
|
|
@@ -380,10 +374,7 @@ class AsyncUsersClient:
|
|
|
380
374
|
|
|
381
375
|
|
|
382
376
|
async def main() -> None:
|
|
383
|
-
await client.users.list_user_roles(
|
|
384
|
-
limit=1000000,
|
|
385
|
-
after="after",
|
|
386
|
-
)
|
|
377
|
+
await client.users.list_user_roles()
|
|
387
378
|
|
|
388
379
|
|
|
389
380
|
asyncio.run(main())
|
|
@@ -433,10 +424,7 @@ class AsyncUsersClient:
|
|
|
433
424
|
|
|
434
425
|
|
|
435
426
|
async def main() -> None:
|
|
436
|
-
await client.users.list_users(
|
|
437
|
-
limit=1000000,
|
|
438
|
-
after="after",
|
|
439
|
-
)
|
|
427
|
+
await client.users.list_users()
|
|
440
428
|
|
|
441
429
|
|
|
442
430
|
asyncio.run(main())
|
|
@@ -77,10 +77,7 @@ class VehicleLocationsClient:
|
|
|
77
77
|
client = Samsara(
|
|
78
78
|
token="YOUR_TOKEN",
|
|
79
79
|
)
|
|
80
|
-
client.vehicle_locations.get_vehicle_locations(
|
|
81
|
-
after="after",
|
|
82
|
-
time="time",
|
|
83
|
-
)
|
|
80
|
+
client.vehicle_locations.get_vehicle_locations()
|
|
84
81
|
"""
|
|
85
82
|
_response = self._raw_client.get_vehicle_locations(
|
|
86
83
|
after=after,
|
|
@@ -147,9 +144,7 @@ class VehicleLocationsClient:
|
|
|
147
144
|
client = Samsara(
|
|
148
145
|
token="YOUR_TOKEN",
|
|
149
146
|
)
|
|
150
|
-
client.vehicle_locations.get_vehicle_locations_feed(
|
|
151
|
-
after="after",
|
|
152
|
-
)
|
|
147
|
+
client.vehicle_locations.get_vehicle_locations_feed()
|
|
153
148
|
"""
|
|
154
149
|
_response = self._raw_client.get_vehicle_locations_feed(
|
|
155
150
|
after=after,
|
|
@@ -218,7 +213,6 @@ class VehicleLocationsClient:
|
|
|
218
213
|
token="YOUR_TOKEN",
|
|
219
214
|
)
|
|
220
215
|
client.vehicle_locations.get_vehicle_locations_history(
|
|
221
|
-
after="after",
|
|
222
216
|
start_time="startTime",
|
|
223
217
|
end_time="endTime",
|
|
224
218
|
)
|
|
@@ -308,10 +302,7 @@ class AsyncVehicleLocationsClient:
|
|
|
308
302
|
|
|
309
303
|
|
|
310
304
|
async def main() -> None:
|
|
311
|
-
await client.vehicle_locations.get_vehicle_locations(
|
|
312
|
-
after="after",
|
|
313
|
-
time="time",
|
|
314
|
-
)
|
|
305
|
+
await client.vehicle_locations.get_vehicle_locations()
|
|
315
306
|
|
|
316
307
|
|
|
317
308
|
asyncio.run(main())
|
|
@@ -386,9 +377,7 @@ class AsyncVehicleLocationsClient:
|
|
|
386
377
|
|
|
387
378
|
|
|
388
379
|
async def main() -> None:
|
|
389
|
-
await client.vehicle_locations.get_vehicle_locations_feed(
|
|
390
|
-
after="after",
|
|
391
|
-
)
|
|
380
|
+
await client.vehicle_locations.get_vehicle_locations_feed()
|
|
392
381
|
|
|
393
382
|
|
|
394
383
|
asyncio.run(main())
|
|
@@ -465,7 +454,6 @@ class AsyncVehicleLocationsClient:
|
|
|
465
454
|
|
|
466
455
|
async def main() -> None:
|
|
467
456
|
await client.vehicle_locations.get_vehicle_locations_history(
|
|
468
|
-
after="after",
|
|
469
457
|
start_time="startTime",
|
|
470
458
|
end_time="endTime",
|
|
471
459
|
)
|