samsara-api 4.2.0__py3-none-any.whl → 4.3.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. samsara/__init__.py +69 -9
  2. samsara/addresses/client.py +7 -14
  3. samsara/addresses/raw_client.py +7 -11
  4. samsara/alerts/client.py +2 -10
  5. samsara/alerts/raw_client.py +180 -180
  6. samsara/assets/__init__.py +3 -3
  7. samsara/assets/client.py +14 -45
  8. samsara/assets/raw_client.py +156 -160
  9. samsara/assets/types/__init__.py +3 -3
  10. samsara/assets/types/{assets_list_request_type.py → list_assets_request_type.py} +1 -1
  11. samsara/attributes/client.py +0 -4
  12. samsara/beta_ap_is/client.py +137 -187
  13. samsara/beta_ap_is/raw_client.py +2035 -1702
  14. samsara/carrier_proposed_assignments/client.py +2 -10
  15. samsara/client.py +5 -0
  16. samsara/coaching/client.py +2 -22
  17. samsara/coaching/raw_client.py +108 -108
  18. samsara/contacts/client.py +2 -8
  19. samsara/core/__init__.py +5 -0
  20. samsara/core/client_wrapper.py +18 -10
  21. samsara/core/custom_pagination.py +152 -0
  22. samsara/core/http_client.py +176 -90
  23. samsara/core/http_sse/__init__.py +42 -0
  24. samsara/core/http_sse/_api.py +112 -0
  25. samsara/core/http_sse/_decoders.py +61 -0
  26. samsara/core/http_sse/_exceptions.py +7 -0
  27. samsara/core/http_sse/_models.py +17 -0
  28. samsara/core/pagination.py +14 -14
  29. samsara/core/pydantic_utilities.py +3 -1
  30. samsara/documents/client.py +2 -12
  31. samsara/documents/raw_client.py +180 -180
  32. samsara/driver_qr_codes/raw_client.py +108 -108
  33. samsara/driver_vehicle_assignments/client.py +0 -12
  34. samsara/driver_vehicle_assignments/raw_client.py +144 -144
  35. samsara/drivers/__init__.py +3 -3
  36. samsara/drivers/client.py +12 -23
  37. samsara/drivers/raw_client.py +48 -52
  38. samsara/drivers/types/__init__.py +3 -3
  39. samsara/drivers/types/{drivers_list_request_driver_activation_status.py → list_drivers_request_driver_activation_status.py} +1 -1
  40. samsara/equipment/client.py +6 -22
  41. samsara/errors/bad_gateway_error.py +1 -1
  42. samsara/errors/gateway_timeout_error.py +1 -1
  43. samsara/errors/internal_server_error.py +1 -1
  44. samsara/errors/method_not_allowed_error.py +1 -1
  45. samsara/errors/not_found_error.py +1 -1
  46. samsara/errors/not_implemented_error.py +1 -1
  47. samsara/errors/service_unavailable_error.py +1 -1
  48. samsara/errors/too_many_requests_error.py +1 -1
  49. samsara/errors/unauthorized_error.py +1 -1
  50. samsara/forms/__init__.py +9 -3
  51. samsara/forms/client.py +17 -10
  52. samsara/forms/raw_client.py +265 -254
  53. samsara/forms/types/__init__.py +6 -2
  54. samsara/forms/types/form_submissions_post_form_submission_request_body_status.py +5 -0
  55. samsara/fuel_and_energy/client.py +0 -30
  56. samsara/fuel_and_energy/raw_client.py +180 -180
  57. samsara/gateways/client.py +2 -6
  58. samsara/gateways/raw_client.py +108 -108
  59. samsara/hours_of_service/__init__.py +6 -3
  60. samsara/hours_of_service/client.py +13 -52
  61. samsara/hours_of_service/raw_client.py +77 -76
  62. samsara/hours_of_service/types/__init__.py +4 -2
  63. samsara/hours_of_service/types/get_hos_daily_logs_request_expand.py +5 -0
  64. samsara/hubs/client.py +2 -94
  65. samsara/hubs/raw_client.py +216 -216
  66. samsara/idling/client.py +0 -18
  67. samsara/idling/raw_client.py +36 -36
  68. samsara/ifta/client.py +4 -34
  69. samsara/ifta/raw_client.py +144 -144
  70. samsara/industrial/client.py +12 -56
  71. samsara/industrial/raw_client.py +40 -48
  72. samsara/issues/client.py +0 -4
  73. samsara/issues/raw_client.py +108 -108
  74. samsara/legacy_ap_is/client.py +4 -56
  75. samsara/legacy_ap_is/raw_client.py +108 -108
  76. samsara/live_sharing_links/client.py +2 -10
  77. samsara/live_sharing_links/raw_client.py +144 -144
  78. samsara/location_and_speed/client.py +2 -20
  79. samsara/location_and_speed/raw_client.py +36 -36
  80. samsara/maintenance/__init__.py +3 -3
  81. samsara/maintenance/client.py +15 -30
  82. samsara/maintenance/raw_client.py +191 -182
  83. samsara/maintenance/types/__init__.py +6 -2
  84. samsara/maintenance/types/create_dvir_request_type.py +5 -0
  85. samsara/media/client.py +0 -4
  86. samsara/media/raw_client.py +108 -108
  87. samsara/messages/client.py +2 -8
  88. samsara/plans/client.py +0 -21
  89. samsara/plans/raw_client.py +72 -72
  90. samsara/preview_ap_is/client.py +0 -140
  91. samsara/preview_ap_is/raw_client.py +72 -430
  92. samsara/route_events/client.py +2 -12
  93. samsara/route_events/raw_client.py +36 -36
  94. samsara/routes/__init__.py +30 -0
  95. samsara/routes/client.py +7 -35
  96. samsara/routes/raw_client.py +257 -256
  97. samsara/routes/types/__init__.py +34 -0
  98. samsara/routes/types/get_routes_feed_request_expand.py +5 -0
  99. samsara/safety/client.py +2 -10
  100. samsara/safety/raw_client.py +36 -36
  101. samsara/settings/raw_client.py +180 -180
  102. samsara/speeding_intervals/raw_client.py +36 -36
  103. samsara/tachograph_eu_only/client.py +0 -6
  104. samsara/tags/client.py +2 -8
  105. samsara/trailer_assignments/client.py +2 -18
  106. samsara/trailers/client.py +2 -12
  107. samsara/trailers/raw_client.py +180 -180
  108. samsara/types/__init__.py +54 -0
  109. samsara/types/create_routes_stop_request_object_request_body.py +7 -0
  110. samsara/types/driver_assignment_object_response_body.py +2 -1
  111. samsara/types/driver_assignment_object_response_body_assignment_type.py +5 -0
  112. samsara/types/driver_external_ids.py +1 -1
  113. samsara/types/forms_approval_config_object_response_body.py +2 -1
  114. samsara/types/forms_approval_config_object_response_body_type.py +5 -0
  115. samsara/types/fuel_level_trigger_details_object_request_body.py +2 -1
  116. samsara/types/fuel_level_trigger_details_object_request_body_operation.py +5 -0
  117. samsara/types/fuel_level_trigger_details_object_response_body.py +4 -1
  118. samsara/types/fuel_level_trigger_details_object_response_body_operation.py +5 -0
  119. samsara/types/idling_event_object_v_20251023_response_body.py +4 -3
  120. samsara/types/idling_event_object_v_20251023_response_body_pto_state.py +5 -0
  121. samsara/types/patch_issue_request_body_assigned_to_request_body.py +2 -1
  122. samsara/types/patch_issue_request_body_assigned_to_request_body_type.py +5 -0
  123. samsara/types/reading_datapoint_request_body.py +5 -4
  124. samsara/types/reading_datapoint_request_body_entity_type.py +5 -0
  125. samsara/types/reading_history_response_body.py +1 -1
  126. samsara/types/reading_snapshot_response_body.py +1 -1
  127. samsara/types/resolved_by.py +2 -1
  128. samsara/types/resolved_by_type.py +5 -0
  129. samsara/types/route_feed_object_response_body.py +2 -1
  130. samsara/types/route_feed_object_response_body_type.py +5 -0
  131. samsara/types/route_settings_request_body.py +8 -0
  132. samsara/types/route_settings_request_body_sequencing_method.py +7 -0
  133. samsara/types/route_settings_response_body.py +8 -0
  134. samsara/types/route_settings_response_body_sequencing_method.py +7 -0
  135. samsara/types/route_stop_details_object_response_body.py +2 -1
  136. samsara/types/route_stop_details_object_response_body_type.py +5 -0
  137. samsara/types/routes_stop_response_object_response_body.py +7 -0
  138. samsara/types/training_learner_object_response_body.py +2 -1
  139. samsara/types/training_learner_object_response_body_type.py +5 -0
  140. samsara/types/update_routes_stop_request_object_request_body.py +7 -0
  141. samsara/types/vehicle_assignment_object_response_body.py +4 -3
  142. samsara/types/vehicle_assignment_object_response_body_assignment_type.py +5 -0
  143. samsara/types/vehicle_external_ids.py +1 -1
  144. samsara/types/work_order_money_object_request_body.py +2 -1
  145. samsara/types/work_order_money_object_request_body_currency.py +5 -0
  146. samsara/types/work_order_money_object_response_body.py +2 -1
  147. samsara/types/work_order_money_object_response_body_currency.py +5 -0
  148. samsara/users/client.py +4 -16
  149. samsara/vehicle_locations/client.py +4 -16
  150. samsara/vehicles/client.py +7 -22
  151. samsara/vehicles/raw_client.py +43 -47
  152. samsara/webhooks/client.py +2 -10
  153. samsara/webhooks/raw_client.py +180 -180
  154. samsara/work_orders/client.py +4 -18
  155. samsara/work_orders/raw_client.py +216 -216
  156. {samsara_api-4.2.0.dist-info → samsara_api-4.3.0.dist-info}/METADATA +2 -1
  157. {samsara_api-4.2.0.dist-info → samsara_api-4.3.0.dist-info}/RECORD +159 -132
  158. {samsara_api-4.2.0.dist-info → samsara_api-4.3.0.dist-info}/LICENSE +0 -0
  159. {samsara_api-4.2.0.dist-info → samsara_api-4.3.0.dist-info}/WHEEL +0 -0
@@ -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:
@@ -0,0 +1,7 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ RouteSettingsResponseBodySequencingMethod = typing.Union[
6
+ typing.Literal["unknown", "scheduledArrivalTime", "manual"], typing.Any
7
+ ]
@@ -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: typing.Literal["route tracking"] = pydantic.Field(default="route tracking")
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
  """
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ RouteStopDetailsObjectResponseBodyType = typing.Union[typing.Literal["route tracking"], typing.Any]
@@ -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: typing.Literal["driver"] = pydantic.Field(default="driver")
20
+ type: TrainingLearnerObjectResponseBodyType = pydantic.Field()
20
21
  """
21
22
  The type of the polymorphic user. Valid values: `driver`
22
23
  """
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ TrainingLearnerObjectResponseBodyType = typing.Union[typing.Literal["driver"], typing.Any]
@@ -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[typing.Literal["driverApp"], FieldMetadata(alias="assignmentType")] = (
14
- pydantic.Field(default="driverApp")
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
  """
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ VehicleAssignmentObjectResponseBodyAssignmentType = typing.Union[typing.Literal["driverApp"], typing.Any]
@@ -2,4 +2,4 @@
2
2
 
3
3
  import typing
4
4
 
5
- VehicleExternalIds = typing.Dict[str, typing.Optional[typing.Any]]
5
+ VehicleExternalIds = typing.Dict[str, typing.Any]
@@ -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: typing.Literal["usd"] = pydantic.Field(default="usd")
20
+ currency: WorkOrderMoneyObjectRequestBodyCurrency = pydantic.Field()
20
21
  """
21
22
  Type of the currency. We currently only support usd. Valid values: `usd`
22
23
  """
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ WorkOrderMoneyObjectRequestBodyCurrency = typing.Union[typing.Literal["usd"], typing.Any]
@@ -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: typing.Literal["usd"] = pydantic.Field(default="usd")
20
+ currency: WorkOrderMoneyObjectResponseBodyCurrency = pydantic.Field()
20
21
  """
21
22
  Type of the currency. We currently only support usd. Valid values: `usd`
22
23
  """
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ WorkOrderMoneyObjectResponseBodyCurrency = typing.Union[typing.Literal["usd"], typing.Any]
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
  )
@@ -12,6 +12,7 @@ from ..types.vehicle_regulation_mode import VehicleRegulationMode
12
12
  from ..types.vehicle_response import VehicleResponse
13
13
  from ..types.vehicle_response_object_response_body import VehicleResponseObjectResponseBody
14
14
  from ..types.vehicle_type import VehicleType
15
+ from ..types.vehicles_list_vehicles_response_body import VehiclesListVehiclesResponseBody
15
16
  from .raw_client import AsyncRawVehiclesClient, RawVehiclesClient
16
17
  from .types.update_vehicle_request_aux_input_type_1 import UpdateVehicleRequestAuxInputType1
17
18
  from .types.update_vehicle_request_aux_input_type_2 import UpdateVehicleRequestAuxInputType2
@@ -61,7 +62,7 @@ class VehiclesClient:
61
62
  updated_after_time: typing.Optional[str] = None,
62
63
  created_after_time: typing.Optional[str] = None,
63
64
  request_options: typing.Optional[RequestOptions] = None,
64
- ) -> SyncPager[VehicleResponseObjectResponseBody]:
65
+ ) -> SyncPager[VehicleResponseObjectResponseBody, VehiclesListVehiclesResponseBody]:
65
66
  """
66
67
  Returns a list of all vehicles.
67
68
 
@@ -103,7 +104,7 @@ class VehiclesClient:
103
104
 
104
105
  Returns
105
106
  -------
106
- SyncPager[VehicleResponseObjectResponseBody]
107
+ SyncPager[VehicleResponseObjectResponseBody, VehiclesListVehiclesResponseBody]
107
108
  OK response.
108
109
 
109
110
  Examples
@@ -113,15 +114,7 @@ class VehiclesClient:
113
114
  client = Samsara(
114
115
  token="YOUR_TOKEN",
115
116
  )
116
- response = client.vehicles.list(
117
- limit=1,
118
- after="after",
119
- parent_tag_ids="parentTagIds",
120
- tag_ids="tagIds",
121
- attribute_value_ids="attributeValueIds",
122
- updated_after_time="updatedAfterTime",
123
- created_after_time="createdAfterTime",
124
- )
117
+ response = client.vehicles.list()
125
118
  for item in response:
126
119
  yield item
127
120
  # alternatively, you can paginate page-by-page
@@ -387,7 +380,7 @@ class AsyncVehiclesClient:
387
380
  updated_after_time: typing.Optional[str] = None,
388
381
  created_after_time: typing.Optional[str] = None,
389
382
  request_options: typing.Optional[RequestOptions] = None,
390
- ) -> AsyncPager[VehicleResponseObjectResponseBody]:
383
+ ) -> AsyncPager[VehicleResponseObjectResponseBody, VehiclesListVehiclesResponseBody]:
391
384
  """
392
385
  Returns a list of all vehicles.
393
386
 
@@ -429,7 +422,7 @@ class AsyncVehiclesClient:
429
422
 
430
423
  Returns
431
424
  -------
432
- AsyncPager[VehicleResponseObjectResponseBody]
425
+ AsyncPager[VehicleResponseObjectResponseBody, VehiclesListVehiclesResponseBody]
433
426
  OK response.
434
427
 
435
428
  Examples
@@ -444,15 +437,7 @@ class AsyncVehiclesClient:
444
437
 
445
438
 
446
439
  async def main() -> None:
447
- response = await client.vehicles.list(
448
- limit=1,
449
- after="after",
450
- parent_tag_ids="parentTagIds",
451
- tag_ids="tagIds",
452
- attribute_value_ids="attributeValueIds",
453
- updated_after_time="updatedAfterTime",
454
- created_after_time="createdAfterTime",
455
- )
440
+ response = await client.vehicles.list()
456
441
  async for item in response:
457
442
  yield item
458
443
 
@@ -7,7 +7,7 @@ from ..core.api_error import ApiError
7
7
  from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
8
8
  from ..core.http_response import AsyncHttpResponse, HttpResponse
9
9
  from ..core.jsonable_encoder import jsonable_encoder
10
- from ..core.pagination import AsyncPager, BaseHttpResponse, SyncPager
10
+ from ..core.pagination import AsyncPager, SyncPager
11
11
  from ..core.pydantic_utilities import parse_obj_as
12
12
  from ..core.request_options import RequestOptions
13
13
  from ..core.serialization import convert_and_respect_annotation_metadata
@@ -65,7 +65,7 @@ class RawVehiclesClient:
65
65
  updated_after_time: typing.Optional[str] = None,
66
66
  created_after_time: typing.Optional[str] = None,
67
67
  request_options: typing.Optional[RequestOptions] = None,
68
- ) -> SyncPager[VehicleResponseObjectResponseBody]:
68
+ ) -> SyncPager[VehicleResponseObjectResponseBody, VehiclesListVehiclesResponseBody]:
69
69
  """
70
70
  Returns a list of all vehicles.
71
71
 
@@ -107,7 +107,7 @@ class RawVehiclesClient:
107
107
 
108
108
  Returns
109
109
  -------
110
- SyncPager[VehicleResponseObjectResponseBody]
110
+ SyncPager[VehicleResponseObjectResponseBody, VehiclesListVehiclesResponseBody]
111
111
  OK response.
112
112
  """
113
113
  _response = self._client_wrapper.httpx_client.request(
@@ -151,16 +151,14 @@ class RawVehiclesClient:
151
151
  created_after_time=created_after_time,
152
152
  request_options=request_options,
153
153
  )
154
- return SyncPager(
155
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
156
- )
154
+ return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
157
155
  if _response.status_code == 401:
158
156
  raise UnauthorizedError(
159
157
  headers=dict(_response.headers),
160
158
  body=typing.cast(
161
- typing.Optional[typing.Any],
159
+ typing.Any,
162
160
  parse_obj_as(
163
- type_=typing.Optional[typing.Any], # type: ignore
161
+ type_=typing.Any, # type: ignore
164
162
  object_=_response.json(),
165
163
  ),
166
164
  ),
@@ -169,9 +167,9 @@ class RawVehiclesClient:
169
167
  raise NotFoundError(
170
168
  headers=dict(_response.headers),
171
169
  body=typing.cast(
172
- typing.Optional[typing.Any],
170
+ typing.Any,
173
171
  parse_obj_as(
174
- type_=typing.Optional[typing.Any], # type: ignore
172
+ type_=typing.Any, # type: ignore
175
173
  object_=_response.json(),
176
174
  ),
177
175
  ),
@@ -180,9 +178,9 @@ class RawVehiclesClient:
180
178
  raise MethodNotAllowedError(
181
179
  headers=dict(_response.headers),
182
180
  body=typing.cast(
183
- typing.Optional[typing.Any],
181
+ typing.Any,
184
182
  parse_obj_as(
185
- type_=typing.Optional[typing.Any], # type: ignore
183
+ type_=typing.Any, # type: ignore
186
184
  object_=_response.json(),
187
185
  ),
188
186
  ),
@@ -191,9 +189,9 @@ class RawVehiclesClient:
191
189
  raise TooManyRequestsError(
192
190
  headers=dict(_response.headers),
193
191
  body=typing.cast(
194
- typing.Optional[typing.Any],
192
+ typing.Any,
195
193
  parse_obj_as(
196
- type_=typing.Optional[typing.Any], # type: ignore
194
+ type_=typing.Any, # type: ignore
197
195
  object_=_response.json(),
198
196
  ),
199
197
  ),
@@ -202,9 +200,9 @@ class RawVehiclesClient:
202
200
  raise InternalServerError(
203
201
  headers=dict(_response.headers),
204
202
  body=typing.cast(
205
- typing.Optional[typing.Any],
203
+ typing.Any,
206
204
  parse_obj_as(
207
- type_=typing.Optional[typing.Any], # type: ignore
205
+ type_=typing.Any, # type: ignore
208
206
  object_=_response.json(),
209
207
  ),
210
208
  ),
@@ -213,9 +211,9 @@ class RawVehiclesClient:
213
211
  raise NotImplementedError(
214
212
  headers=dict(_response.headers),
215
213
  body=typing.cast(
216
- typing.Optional[typing.Any],
214
+ typing.Any,
217
215
  parse_obj_as(
218
- type_=typing.Optional[typing.Any], # type: ignore
216
+ type_=typing.Any, # type: ignore
219
217
  object_=_response.json(),
220
218
  ),
221
219
  ),
@@ -224,9 +222,9 @@ class RawVehiclesClient:
224
222
  raise BadGatewayError(
225
223
  headers=dict(_response.headers),
226
224
  body=typing.cast(
227
- typing.Optional[typing.Any],
225
+ typing.Any,
228
226
  parse_obj_as(
229
- type_=typing.Optional[typing.Any], # type: ignore
227
+ type_=typing.Any, # type: ignore
230
228
  object_=_response.json(),
231
229
  ),
232
230
  ),
@@ -235,9 +233,9 @@ class RawVehiclesClient:
235
233
  raise ServiceUnavailableError(
236
234
  headers=dict(_response.headers),
237
235
  body=typing.cast(
238
- typing.Optional[typing.Any],
236
+ typing.Any,
239
237
  parse_obj_as(
240
- type_=typing.Optional[typing.Any], # type: ignore
238
+ type_=typing.Any, # type: ignore
241
239
  object_=_response.json(),
242
240
  ),
243
241
  ),
@@ -246,9 +244,9 @@ class RawVehiclesClient:
246
244
  raise GatewayTimeoutError(
247
245
  headers=dict(_response.headers),
248
246
  body=typing.cast(
249
- typing.Optional[typing.Any],
247
+ typing.Any,
250
248
  parse_obj_as(
251
- type_=typing.Optional[typing.Any], # type: ignore
249
+ type_=typing.Any, # type: ignore
252
250
  object_=_response.json(),
253
251
  ),
254
252
  ),
@@ -513,7 +511,7 @@ class AsyncRawVehiclesClient:
513
511
  updated_after_time: typing.Optional[str] = None,
514
512
  created_after_time: typing.Optional[str] = None,
515
513
  request_options: typing.Optional[RequestOptions] = None,
516
- ) -> AsyncPager[VehicleResponseObjectResponseBody]:
514
+ ) -> AsyncPager[VehicleResponseObjectResponseBody, VehiclesListVehiclesResponseBody]:
517
515
  """
518
516
  Returns a list of all vehicles.
519
517
 
@@ -555,7 +553,7 @@ class AsyncRawVehiclesClient:
555
553
 
556
554
  Returns
557
555
  -------
558
- AsyncPager[VehicleResponseObjectResponseBody]
556
+ AsyncPager[VehicleResponseObjectResponseBody, VehiclesListVehiclesResponseBody]
559
557
  OK response.
560
558
  """
561
559
  _response = await self._client_wrapper.httpx_client.request(
@@ -602,16 +600,14 @@ class AsyncRawVehiclesClient:
602
600
  request_options=request_options,
603
601
  )
604
602
 
605
- return AsyncPager(
606
- has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
607
- )
603
+ return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
608
604
  if _response.status_code == 401:
609
605
  raise UnauthorizedError(
610
606
  headers=dict(_response.headers),
611
607
  body=typing.cast(
612
- typing.Optional[typing.Any],
608
+ typing.Any,
613
609
  parse_obj_as(
614
- type_=typing.Optional[typing.Any], # type: ignore
610
+ type_=typing.Any, # type: ignore
615
611
  object_=_response.json(),
616
612
  ),
617
613
  ),
@@ -620,9 +616,9 @@ class AsyncRawVehiclesClient:
620
616
  raise NotFoundError(
621
617
  headers=dict(_response.headers),
622
618
  body=typing.cast(
623
- typing.Optional[typing.Any],
619
+ typing.Any,
624
620
  parse_obj_as(
625
- type_=typing.Optional[typing.Any], # type: ignore
621
+ type_=typing.Any, # type: ignore
626
622
  object_=_response.json(),
627
623
  ),
628
624
  ),
@@ -631,9 +627,9 @@ class AsyncRawVehiclesClient:
631
627
  raise MethodNotAllowedError(
632
628
  headers=dict(_response.headers),
633
629
  body=typing.cast(
634
- typing.Optional[typing.Any],
630
+ typing.Any,
635
631
  parse_obj_as(
636
- type_=typing.Optional[typing.Any], # type: ignore
632
+ type_=typing.Any, # type: ignore
637
633
  object_=_response.json(),
638
634
  ),
639
635
  ),
@@ -642,9 +638,9 @@ class AsyncRawVehiclesClient:
642
638
  raise TooManyRequestsError(
643
639
  headers=dict(_response.headers),
644
640
  body=typing.cast(
645
- typing.Optional[typing.Any],
641
+ typing.Any,
646
642
  parse_obj_as(
647
- type_=typing.Optional[typing.Any], # type: ignore
643
+ type_=typing.Any, # type: ignore
648
644
  object_=_response.json(),
649
645
  ),
650
646
  ),
@@ -653,9 +649,9 @@ class AsyncRawVehiclesClient:
653
649
  raise InternalServerError(
654
650
  headers=dict(_response.headers),
655
651
  body=typing.cast(
656
- typing.Optional[typing.Any],
652
+ typing.Any,
657
653
  parse_obj_as(
658
- type_=typing.Optional[typing.Any], # type: ignore
654
+ type_=typing.Any, # type: ignore
659
655
  object_=_response.json(),
660
656
  ),
661
657
  ),
@@ -664,9 +660,9 @@ class AsyncRawVehiclesClient:
664
660
  raise NotImplementedError(
665
661
  headers=dict(_response.headers),
666
662
  body=typing.cast(
667
- typing.Optional[typing.Any],
663
+ typing.Any,
668
664
  parse_obj_as(
669
- type_=typing.Optional[typing.Any], # type: ignore
665
+ type_=typing.Any, # type: ignore
670
666
  object_=_response.json(),
671
667
  ),
672
668
  ),
@@ -675,9 +671,9 @@ class AsyncRawVehiclesClient:
675
671
  raise BadGatewayError(
676
672
  headers=dict(_response.headers),
677
673
  body=typing.cast(
678
- typing.Optional[typing.Any],
674
+ typing.Any,
679
675
  parse_obj_as(
680
- type_=typing.Optional[typing.Any], # type: ignore
676
+ type_=typing.Any, # type: ignore
681
677
  object_=_response.json(),
682
678
  ),
683
679
  ),
@@ -686,9 +682,9 @@ class AsyncRawVehiclesClient:
686
682
  raise ServiceUnavailableError(
687
683
  headers=dict(_response.headers),
688
684
  body=typing.cast(
689
- typing.Optional[typing.Any],
685
+ typing.Any,
690
686
  parse_obj_as(
691
- type_=typing.Optional[typing.Any], # type: ignore
687
+ type_=typing.Any, # type: ignore
692
688
  object_=_response.json(),
693
689
  ),
694
690
  ),
@@ -697,9 +693,9 @@ class AsyncRawVehiclesClient:
697
693
  raise GatewayTimeoutError(
698
694
  headers=dict(_response.headers),
699
695
  body=typing.cast(
700
- typing.Optional[typing.Any],
696
+ typing.Any,
701
697
  parse_obj_as(
702
- type_=typing.Optional[typing.Any], # type: ignore
698
+ type_=typing.Any, # type: ignore
703
699
  object_=_response.json(),
704
700
  ),
705
701
  ),