samsara-api 5.3.1__py3-none-any.whl → 5.4.1__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 (28) hide show
  1. samsara/__init__.py +6 -0
  2. samsara/alerts/client.py +4 -0
  3. samsara/alerts/raw_client.py +4 -0
  4. samsara/beta_ap_is/client.py +0 -630
  5. samsara/beta_ap_is/raw_client.py +1496 -3144
  6. samsara/client.py +38 -0
  7. samsara/core/client_wrapper.py +2 -2
  8. samsara/media/client.py +4 -4
  9. samsara/media/raw_client.py +4 -4
  10. samsara/training_assignments/__init__.py +4 -0
  11. samsara/training_assignments/client.py +528 -0
  12. samsara/training_assignments/raw_client.py +1330 -0
  13. samsara/training_courses/__init__.py +4 -0
  14. samsara/training_courses/client.py +168 -0
  15. samsara/training_courses/raw_client.py +364 -0
  16. samsara/types/harsh_event_trigger_details_object_request_body_types_item.py +1 -0
  17. samsara/types/harsh_event_trigger_details_object_response_body_types_item.py +1 -0
  18. samsara/types/webhook_response_response_body_event_types_item.py +1 -0
  19. samsara/types/webhooks_get_webhook_response_body_event_types_item.py +1 -0
  20. samsara/types/webhooks_patch_webhook_response_body_event_types_item.py +1 -0
  21. samsara/types/webhooks_post_webhooks_response_body_event_types_item.py +1 -0
  22. samsara/types/workflow_trigger_object_request_body.py +2 -4
  23. samsara/types/workflow_trigger_object_response_body.py +2 -4
  24. samsara/webhooks/types/webhooks_post_webhooks_request_body_event_types_item.py +1 -0
  25. {samsara_api-5.3.1.dist-info → samsara_api-5.4.1.dist-info}/METADATA +1 -1
  26. {samsara_api-5.3.1.dist-info → samsara_api-5.4.1.dist-info}/RECORD +28 -22
  27. {samsara_api-5.3.1.dist-info → samsara_api-5.4.1.dist-info}/LICENSE +0 -0
  28. {samsara_api-5.3.1.dist-info → samsara_api-5.4.1.dist-info}/WHEEL +0 -0
@@ -77,16 +77,6 @@ from ..types.trailer_stats_get_trailer_stats_history_response_body import Traile
77
77
  from ..types.trailer_stats_get_trailer_stats_snapshot_response_body import (
78
78
  TrailerStatsGetTrailerStatsSnapshotResponseBody,
79
79
  )
80
- from ..types.training_assignments_get_training_assignments_stream_response_body import (
81
- TrainingAssignmentsGetTrainingAssignmentsStreamResponseBody,
82
- )
83
- from ..types.training_assignments_patch_training_assignments_response_body import (
84
- TrainingAssignmentsPatchTrainingAssignmentsResponseBody,
85
- )
86
- from ..types.training_assignments_post_training_assignments_response_body import (
87
- TrainingAssignmentsPostTrainingAssignmentsResponseBody,
88
- )
89
- from ..types.training_courses_get_training_courses_response_body import TrainingCoursesGetTrainingCoursesResponseBody
90
80
  from ..types.update_engine_immobilizer_relay_state_request_body_request_body import (
91
81
  UpdateEngineImmobilizerRelayStateRequestBodyRequestBody,
92
82
  )
@@ -3034,296 +3024,6 @@ class BetaApIsClient:
3034
3024
  )
3035
3025
  return _response.data
3036
3026
 
3037
- def post_training_assignments(
3038
- self,
3039
- *,
3040
- course_id: str,
3041
- due_at_time: str,
3042
- learner_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
3043
- request_options: typing.Optional[RequestOptions] = None,
3044
- ) -> TrainingAssignmentsPostTrainingAssignmentsResponseBody:
3045
- """
3046
- Create training assignments. Existing assignments will remain unchanged.
3047
-
3048
- **Beta:** This endpoint is in beta and is likely to change before being broadly available. Reach out to your Samsara Representative to have Training APIs enabled for your organization.
3049
-
3050
- <b>Rate limit:</b> 10 requests/sec (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).
3051
-
3052
- To use this endpoint, select **Write Training Assignments** under the Training Assignments 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>
3053
-
3054
-
3055
- **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.
3056
-
3057
- Parameters
3058
- ----------
3059
- course_id : str
3060
- String for the course ID.
3061
-
3062
- due_at_time : str
3063
- Due date of the training assignment in RFC 3339 format. Millisecond precision and timezones are supported.
3064
-
3065
- learner_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
3066
- Optional string of comma separated learner IDs. If learner ID is present, training assignments for the specified learner(s) will be returned. Max value for this value is 100 objects. Example: `learnerIds=driver-281474,driver-46282156`
3067
-
3068
- request_options : typing.Optional[RequestOptions]
3069
- Request-specific configuration.
3070
-
3071
- Returns
3072
- -------
3073
- TrainingAssignmentsPostTrainingAssignmentsResponseBody
3074
- OK response.
3075
-
3076
- Examples
3077
- --------
3078
- from samsara import Samsara
3079
-
3080
- client = Samsara(
3081
- token="YOUR_TOKEN",
3082
- )
3083
- client.beta_ap_is.post_training_assignments(
3084
- course_id="courseId",
3085
- due_at_time="dueAtTime",
3086
- )
3087
- """
3088
- _response = self._raw_client.post_training_assignments(
3089
- course_id=course_id, due_at_time=due_at_time, learner_ids=learner_ids, request_options=request_options
3090
- )
3091
- return _response.data
3092
-
3093
- def delete_training_assignments(
3094
- self,
3095
- *,
3096
- ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
3097
- request_options: typing.Optional[RequestOptions] = None,
3098
- ) -> None:
3099
- """
3100
- This endpoint supports batch deletion operations. The response does not indicate which specific deletions, if any, have failed. On a successful deletion or partial failure, a ‘204 No Content’ status is returned.
3101
-
3102
- **Beta:** This endpoint is in beta and is likely to change before being broadly available. Reach out to your Samsara Representative to have Training APIs enabled for your organization.
3103
-
3104
- <b>Rate limit:</b> 10 requests/sec (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).
3105
-
3106
- To use this endpoint, select **Write Training Assignments** under the Training Assignments 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>
3107
-
3108
-
3109
- **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.
3110
-
3111
- Parameters
3112
- ----------
3113
- ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
3114
- String of comma separated assignments IDs. Max value for this value is 100 objects. Example: `ids=a4db8702-79d5-4396-a717-e301d52ecc11,c6490f6a-d84e-49b5-b0ad-b6baae304075`
3115
-
3116
- request_options : typing.Optional[RequestOptions]
3117
- Request-specific configuration.
3118
-
3119
- Returns
3120
- -------
3121
- None
3122
-
3123
- Examples
3124
- --------
3125
- from samsara import Samsara
3126
-
3127
- client = Samsara(
3128
- token="YOUR_TOKEN",
3129
- )
3130
- client.beta_ap_is.delete_training_assignments()
3131
- """
3132
- _response = self._raw_client.delete_training_assignments(ids=ids, request_options=request_options)
3133
- return _response.data
3134
-
3135
- def patch_training_assignments(
3136
- self,
3137
- *,
3138
- due_at_time: str,
3139
- ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
3140
- request_options: typing.Optional[RequestOptions] = None,
3141
- ) -> TrainingAssignmentsPatchTrainingAssignmentsResponseBody:
3142
- """
3143
- Update training assignments.
3144
-
3145
- **Beta:** This endpoint is in beta and is likely to change before being broadly available. Reach out to your Samsara Representative to have Training APIs enabled for your organization.
3146
-
3147
- <b>Rate limit:</b> 10 requests/sec (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).
3148
-
3149
- To use this endpoint, select **Write Training Assignments** under the Training Assignments 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>
3150
-
3151
-
3152
- **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.
3153
-
3154
- Parameters
3155
- ----------
3156
- due_at_time : str
3157
- Due date of the training assignment in RFC 3339 format. Millisecond precision and timezones are supported.
3158
-
3159
- ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
3160
- String of comma separated assignments IDs. Max value for this value is 100 objects. Example: `ids=a4db8702-79d5-4396-a717-e301d52ecc11,c6490f6a-d84e-49b5-b0ad-b6baae304075`
3161
-
3162
- request_options : typing.Optional[RequestOptions]
3163
- Request-specific configuration.
3164
-
3165
- Returns
3166
- -------
3167
- TrainingAssignmentsPatchTrainingAssignmentsResponseBody
3168
- OK response.
3169
-
3170
- Examples
3171
- --------
3172
- from samsara import Samsara
3173
-
3174
- client = Samsara(
3175
- token="YOUR_TOKEN",
3176
- )
3177
- client.beta_ap_is.patch_training_assignments(
3178
- due_at_time="dueAtTime",
3179
- )
3180
- """
3181
- _response = self._raw_client.patch_training_assignments(
3182
- due_at_time=due_at_time, ids=ids, request_options=request_options
3183
- )
3184
- return _response.data
3185
-
3186
- def get_training_assignments_stream(
3187
- self,
3188
- *,
3189
- start_time: str,
3190
- after: typing.Optional[str] = None,
3191
- end_time: typing.Optional[str] = None,
3192
- learner_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
3193
- course_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
3194
- status: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
3195
- is_overdue: typing.Optional[bool] = None,
3196
- category_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
3197
- request_options: typing.Optional[RequestOptions] = None,
3198
- ) -> TrainingAssignmentsGetTrainingAssignmentsStreamResponseBody:
3199
- """
3200
- Returns all training assignments data that has been created or modified for your organization based on the time parameters passed in. Results are paginated and are sorted by last modified date. If you include an endTime, the endpoint will return data up until that point (exclusive). If you don't include an endTime, the API will continue to poll with the pagination cursor that gets returned on every call. The hasNextPage response value will be true if there is no endTime specified and endCursor is nonempty.
3201
-
3202
- <b>Rate limit:</b> 5 requests/sec (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).
3203
-
3204
- To use this endpoint, select **Read Training Assignments** under the Training Assignments 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>
3205
-
3206
-
3207
- **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.
3208
-
3209
- Parameters
3210
- ----------
3211
- start_time : str
3212
- A start time in RFC 3339 format. Defaults to now if not provided. Millisecond precision and timezones are supported. (Examples: 2019-06-13T19:08:25Z, 2019-06-13T19:08:25.455Z, OR 2015-09-15T14:00:12-04:00).
3213
-
3214
- after : typing.Optional[str]
3215
- If specified, this should be the endCursor value from the previous page of results. When present, this request will return the next page of results that occur immediately after the previous page of results.
3216
-
3217
- end_time : typing.Optional[str]
3218
- An end time in RFC 3339 format. Defaults to now if not provided. Millisecond precision and timezones are supported. (Examples: 2019-06-13T19:08:25Z, 2019-06-13T19:08:25.455Z, OR 2015-09-15T14:00:12-04:00).
3219
-
3220
- learner_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
3221
- Optional string of comma separated learner IDs. If learner ID is present, training assignments for the specified learner(s) will be returned. Max value for this value is 100 objects. Example: `learnerIds=driver-281474,driver-46282156`
3222
-
3223
- course_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
3224
- Optional string of comma separated course IDs. If course ID is present, training assignments for the specified course ID(s) will be returned. Max value for this value is 100 objects. Defaults to returning all courses. Example: `courseIds=a4db8702-79d5-4396-a717-e301d52ecc11,c6490f6a-d84e-49b5-b0ad-b6baae304075`
3225
-
3226
- status : typing.Optional[typing.Union[str, typing.Sequence[str]]]
3227
- Optional string of comma separated values. If status is present, training assignments for the specified status(s) will be returned. Valid values: "notStarted", "inProgress", "completed". Defaults to returning all courses.
3228
-
3229
- is_overdue : typing.Optional[bool]
3230
- Optional boolean value. If present, training assignments for the specified overdue status will be returned. Valid values: true, false. Defaults to returning all assignments.
3231
-
3232
- category_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
3233
- Optional string of comma separated category IDs. If category ID is present, training assignments for the specified category ID(s) will be returned. Max value for this value is 100 objects. Example: `categoryIds=a4db8702-79d5-4396-a717-e301d52ecc11,c6490f6a-d84e-49b5-b0ad-b6baae304075`
3234
-
3235
- request_options : typing.Optional[RequestOptions]
3236
- Request-specific configuration.
3237
-
3238
- Returns
3239
- -------
3240
- TrainingAssignmentsGetTrainingAssignmentsStreamResponseBody
3241
- OK response.
3242
-
3243
- Examples
3244
- --------
3245
- from samsara import Samsara
3246
-
3247
- client = Samsara(
3248
- token="YOUR_TOKEN",
3249
- )
3250
- client.beta_ap_is.get_training_assignments_stream(
3251
- start_time="startTime",
3252
- )
3253
- """
3254
- _response = self._raw_client.get_training_assignments_stream(
3255
- start_time=start_time,
3256
- after=after,
3257
- end_time=end_time,
3258
- learner_ids=learner_ids,
3259
- course_ids=course_ids,
3260
- status=status,
3261
- is_overdue=is_overdue,
3262
- category_ids=category_ids,
3263
- request_options=request_options,
3264
- )
3265
- return _response.data
3266
-
3267
- def get_training_courses(
3268
- self,
3269
- *,
3270
- after: typing.Optional[str] = None,
3271
- course_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
3272
- category_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
3273
- status: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
3274
- request_options: typing.Optional[RequestOptions] = None,
3275
- ) -> TrainingCoursesGetTrainingCoursesResponseBody:
3276
- """
3277
- Returns all training courses data. Results are paginated.
3278
- Courses in the ‘draft’ status are excluded from the data returned by this endpoint.
3279
-
3280
- <b>Rate limit:</b> 5 requests/sec (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).
3281
-
3282
- To use this endpoint, select **Read Training Courses** under the Training Courses 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>
3283
-
3284
-
3285
- **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.
3286
-
3287
- Parameters
3288
- ----------
3289
- after : typing.Optional[str]
3290
- If specified, this should be the endCursor value from the previous page of results. When present, this request will return the next page of results that occur immediately after the previous page of results.
3291
-
3292
- course_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
3293
- Optional string of comma separated course IDs. If course ID is present, training assignments for the specified course ID(s) will be returned. Max value for this value is 100 objects. Defaults to returning all courses. Example: `courseIds=a4db8702-79d5-4396-a717-e301d52ecc11,c6490f6a-d84e-49b5-b0ad-b6baae304075`
3294
-
3295
- category_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
3296
- Optional string of comma separated course category IDs. If courseCategoryId is present, training courses for the specified course category(s) will be returned. Max value for this value is 100 objects. Defaults to returning all courses. Example: `categoryIds=a4db8702-79d5-4396-a717-e301d52ecc11,c6490f6a-d84e-49b5-b0ad-b6baae304075`
3297
-
3298
- status : typing.Optional[typing.Union[str, typing.Sequence[str]]]
3299
- Optional string of comma separated values. If status is present, training courses with the specified status(s) will be returned. Valid values: “published”, “deleted”, “archived”. Defaults to returning all courses.
3300
-
3301
- request_options : typing.Optional[RequestOptions]
3302
- Request-specific configuration.
3303
-
3304
- Returns
3305
- -------
3306
- TrainingCoursesGetTrainingCoursesResponseBody
3307
- OK response.
3308
-
3309
- Examples
3310
- --------
3311
- from samsara import Samsara
3312
-
3313
- client = Samsara(
3314
- token="YOUR_TOKEN",
3315
- )
3316
- client.beta_ap_is.get_training_courses()
3317
- """
3318
- _response = self._raw_client.get_training_courses(
3319
- after=after,
3320
- course_ids=course_ids,
3321
- category_ids=category_ids,
3322
- status=status,
3323
- request_options=request_options,
3324
- )
3325
- return _response.data
3326
-
3327
3027
 
3328
3028
  class AsyncBetaApIsClient:
3329
3029
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
@@ -6606,333 +6306,3 @@ class AsyncBetaApIsClient:
6606
6306
  request_options=request_options,
6607
6307
  )
6608
6308
  return _response.data
6609
-
6610
- async def post_training_assignments(
6611
- self,
6612
- *,
6613
- course_id: str,
6614
- due_at_time: str,
6615
- learner_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
6616
- request_options: typing.Optional[RequestOptions] = None,
6617
- ) -> TrainingAssignmentsPostTrainingAssignmentsResponseBody:
6618
- """
6619
- Create training assignments. Existing assignments will remain unchanged.
6620
-
6621
- **Beta:** This endpoint is in beta and is likely to change before being broadly available. Reach out to your Samsara Representative to have Training APIs enabled for your organization.
6622
-
6623
- <b>Rate limit:</b> 10 requests/sec (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).
6624
-
6625
- To use this endpoint, select **Write Training Assignments** under the Training Assignments 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>
6626
-
6627
-
6628
- **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.
6629
-
6630
- Parameters
6631
- ----------
6632
- course_id : str
6633
- String for the course ID.
6634
-
6635
- due_at_time : str
6636
- Due date of the training assignment in RFC 3339 format. Millisecond precision and timezones are supported.
6637
-
6638
- learner_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
6639
- Optional string of comma separated learner IDs. If learner ID is present, training assignments for the specified learner(s) will be returned. Max value for this value is 100 objects. Example: `learnerIds=driver-281474,driver-46282156`
6640
-
6641
- request_options : typing.Optional[RequestOptions]
6642
- Request-specific configuration.
6643
-
6644
- Returns
6645
- -------
6646
- TrainingAssignmentsPostTrainingAssignmentsResponseBody
6647
- OK response.
6648
-
6649
- Examples
6650
- --------
6651
- import asyncio
6652
-
6653
- from samsara import AsyncSamsara
6654
-
6655
- client = AsyncSamsara(
6656
- token="YOUR_TOKEN",
6657
- )
6658
-
6659
-
6660
- async def main() -> None:
6661
- await client.beta_ap_is.post_training_assignments(
6662
- course_id="courseId",
6663
- due_at_time="dueAtTime",
6664
- )
6665
-
6666
-
6667
- asyncio.run(main())
6668
- """
6669
- _response = await self._raw_client.post_training_assignments(
6670
- course_id=course_id, due_at_time=due_at_time, learner_ids=learner_ids, request_options=request_options
6671
- )
6672
- return _response.data
6673
-
6674
- async def delete_training_assignments(
6675
- self,
6676
- *,
6677
- ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
6678
- request_options: typing.Optional[RequestOptions] = None,
6679
- ) -> None:
6680
- """
6681
- This endpoint supports batch deletion operations. The response does not indicate which specific deletions, if any, have failed. On a successful deletion or partial failure, a ‘204 No Content’ status is returned.
6682
-
6683
- **Beta:** This endpoint is in beta and is likely to change before being broadly available. Reach out to your Samsara Representative to have Training APIs enabled for your organization.
6684
-
6685
- <b>Rate limit:</b> 10 requests/sec (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).
6686
-
6687
- To use this endpoint, select **Write Training Assignments** under the Training Assignments 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>
6688
-
6689
-
6690
- **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.
6691
-
6692
- Parameters
6693
- ----------
6694
- ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
6695
- String of comma separated assignments IDs. Max value for this value is 100 objects. Example: `ids=a4db8702-79d5-4396-a717-e301d52ecc11,c6490f6a-d84e-49b5-b0ad-b6baae304075`
6696
-
6697
- request_options : typing.Optional[RequestOptions]
6698
- Request-specific configuration.
6699
-
6700
- Returns
6701
- -------
6702
- None
6703
-
6704
- Examples
6705
- --------
6706
- import asyncio
6707
-
6708
- from samsara import AsyncSamsara
6709
-
6710
- client = AsyncSamsara(
6711
- token="YOUR_TOKEN",
6712
- )
6713
-
6714
-
6715
- async def main() -> None:
6716
- await client.beta_ap_is.delete_training_assignments()
6717
-
6718
-
6719
- asyncio.run(main())
6720
- """
6721
- _response = await self._raw_client.delete_training_assignments(ids=ids, request_options=request_options)
6722
- return _response.data
6723
-
6724
- async def patch_training_assignments(
6725
- self,
6726
- *,
6727
- due_at_time: str,
6728
- ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
6729
- request_options: typing.Optional[RequestOptions] = None,
6730
- ) -> TrainingAssignmentsPatchTrainingAssignmentsResponseBody:
6731
- """
6732
- Update training assignments.
6733
-
6734
- **Beta:** This endpoint is in beta and is likely to change before being broadly available. Reach out to your Samsara Representative to have Training APIs enabled for your organization.
6735
-
6736
- <b>Rate limit:</b> 10 requests/sec (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).
6737
-
6738
- To use this endpoint, select **Write Training Assignments** under the Training Assignments 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>
6739
-
6740
-
6741
- **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.
6742
-
6743
- Parameters
6744
- ----------
6745
- due_at_time : str
6746
- Due date of the training assignment in RFC 3339 format. Millisecond precision and timezones are supported.
6747
-
6748
- ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
6749
- String of comma separated assignments IDs. Max value for this value is 100 objects. Example: `ids=a4db8702-79d5-4396-a717-e301d52ecc11,c6490f6a-d84e-49b5-b0ad-b6baae304075`
6750
-
6751
- request_options : typing.Optional[RequestOptions]
6752
- Request-specific configuration.
6753
-
6754
- Returns
6755
- -------
6756
- TrainingAssignmentsPatchTrainingAssignmentsResponseBody
6757
- OK response.
6758
-
6759
- Examples
6760
- --------
6761
- import asyncio
6762
-
6763
- from samsara import AsyncSamsara
6764
-
6765
- client = AsyncSamsara(
6766
- token="YOUR_TOKEN",
6767
- )
6768
-
6769
-
6770
- async def main() -> None:
6771
- await client.beta_ap_is.patch_training_assignments(
6772
- due_at_time="dueAtTime",
6773
- )
6774
-
6775
-
6776
- asyncio.run(main())
6777
- """
6778
- _response = await self._raw_client.patch_training_assignments(
6779
- due_at_time=due_at_time, ids=ids, request_options=request_options
6780
- )
6781
- return _response.data
6782
-
6783
- async def get_training_assignments_stream(
6784
- self,
6785
- *,
6786
- start_time: str,
6787
- after: typing.Optional[str] = None,
6788
- end_time: typing.Optional[str] = None,
6789
- learner_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
6790
- course_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
6791
- status: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
6792
- is_overdue: typing.Optional[bool] = None,
6793
- category_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
6794
- request_options: typing.Optional[RequestOptions] = None,
6795
- ) -> TrainingAssignmentsGetTrainingAssignmentsStreamResponseBody:
6796
- """
6797
- Returns all training assignments data that has been created or modified for your organization based on the time parameters passed in. Results are paginated and are sorted by last modified date. If you include an endTime, the endpoint will return data up until that point (exclusive). If you don't include an endTime, the API will continue to poll with the pagination cursor that gets returned on every call. The hasNextPage response value will be true if there is no endTime specified and endCursor is nonempty.
6798
-
6799
- <b>Rate limit:</b> 5 requests/sec (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).
6800
-
6801
- To use this endpoint, select **Read Training Assignments** under the Training Assignments 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>
6802
-
6803
-
6804
- **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.
6805
-
6806
- Parameters
6807
- ----------
6808
- start_time : str
6809
- A start time in RFC 3339 format. Defaults to now if not provided. Millisecond precision and timezones are supported. (Examples: 2019-06-13T19:08:25Z, 2019-06-13T19:08:25.455Z, OR 2015-09-15T14:00:12-04:00).
6810
-
6811
- after : typing.Optional[str]
6812
- If specified, this should be the endCursor value from the previous page of results. When present, this request will return the next page of results that occur immediately after the previous page of results.
6813
-
6814
- end_time : typing.Optional[str]
6815
- An end time in RFC 3339 format. Defaults to now if not provided. Millisecond precision and timezones are supported. (Examples: 2019-06-13T19:08:25Z, 2019-06-13T19:08:25.455Z, OR 2015-09-15T14:00:12-04:00).
6816
-
6817
- learner_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
6818
- Optional string of comma separated learner IDs. If learner ID is present, training assignments for the specified learner(s) will be returned. Max value for this value is 100 objects. Example: `learnerIds=driver-281474,driver-46282156`
6819
-
6820
- course_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
6821
- Optional string of comma separated course IDs. If course ID is present, training assignments for the specified course ID(s) will be returned. Max value for this value is 100 objects. Defaults to returning all courses. Example: `courseIds=a4db8702-79d5-4396-a717-e301d52ecc11,c6490f6a-d84e-49b5-b0ad-b6baae304075`
6822
-
6823
- status : typing.Optional[typing.Union[str, typing.Sequence[str]]]
6824
- Optional string of comma separated values. If status is present, training assignments for the specified status(s) will be returned. Valid values: "notStarted", "inProgress", "completed". Defaults to returning all courses.
6825
-
6826
- is_overdue : typing.Optional[bool]
6827
- Optional boolean value. If present, training assignments for the specified overdue status will be returned. Valid values: true, false. Defaults to returning all assignments.
6828
-
6829
- category_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
6830
- Optional string of comma separated category IDs. If category ID is present, training assignments for the specified category ID(s) will be returned. Max value for this value is 100 objects. Example: `categoryIds=a4db8702-79d5-4396-a717-e301d52ecc11,c6490f6a-d84e-49b5-b0ad-b6baae304075`
6831
-
6832
- request_options : typing.Optional[RequestOptions]
6833
- Request-specific configuration.
6834
-
6835
- Returns
6836
- -------
6837
- TrainingAssignmentsGetTrainingAssignmentsStreamResponseBody
6838
- OK response.
6839
-
6840
- Examples
6841
- --------
6842
- import asyncio
6843
-
6844
- from samsara import AsyncSamsara
6845
-
6846
- client = AsyncSamsara(
6847
- token="YOUR_TOKEN",
6848
- )
6849
-
6850
-
6851
- async def main() -> None:
6852
- await client.beta_ap_is.get_training_assignments_stream(
6853
- start_time="startTime",
6854
- )
6855
-
6856
-
6857
- asyncio.run(main())
6858
- """
6859
- _response = await self._raw_client.get_training_assignments_stream(
6860
- start_time=start_time,
6861
- after=after,
6862
- end_time=end_time,
6863
- learner_ids=learner_ids,
6864
- course_ids=course_ids,
6865
- status=status,
6866
- is_overdue=is_overdue,
6867
- category_ids=category_ids,
6868
- request_options=request_options,
6869
- )
6870
- return _response.data
6871
-
6872
- async def get_training_courses(
6873
- self,
6874
- *,
6875
- after: typing.Optional[str] = None,
6876
- course_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
6877
- category_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
6878
- status: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
6879
- request_options: typing.Optional[RequestOptions] = None,
6880
- ) -> TrainingCoursesGetTrainingCoursesResponseBody:
6881
- """
6882
- Returns all training courses data. Results are paginated.
6883
- Courses in the ‘draft’ status are excluded from the data returned by this endpoint.
6884
-
6885
- <b>Rate limit:</b> 5 requests/sec (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).
6886
-
6887
- To use this endpoint, select **Read Training Courses** under the Training Courses 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>
6888
-
6889
-
6890
- **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.
6891
-
6892
- Parameters
6893
- ----------
6894
- after : typing.Optional[str]
6895
- If specified, this should be the endCursor value from the previous page of results. When present, this request will return the next page of results that occur immediately after the previous page of results.
6896
-
6897
- course_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
6898
- Optional string of comma separated course IDs. If course ID is present, training assignments for the specified course ID(s) will be returned. Max value for this value is 100 objects. Defaults to returning all courses. Example: `courseIds=a4db8702-79d5-4396-a717-e301d52ecc11,c6490f6a-d84e-49b5-b0ad-b6baae304075`
6899
-
6900
- category_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
6901
- Optional string of comma separated course category IDs. If courseCategoryId is present, training courses for the specified course category(s) will be returned. Max value for this value is 100 objects. Defaults to returning all courses. Example: `categoryIds=a4db8702-79d5-4396-a717-e301d52ecc11,c6490f6a-d84e-49b5-b0ad-b6baae304075`
6902
-
6903
- status : typing.Optional[typing.Union[str, typing.Sequence[str]]]
6904
- Optional string of comma separated values. If status is present, training courses with the specified status(s) will be returned. Valid values: “published”, “deleted”, “archived”. Defaults to returning all courses.
6905
-
6906
- request_options : typing.Optional[RequestOptions]
6907
- Request-specific configuration.
6908
-
6909
- Returns
6910
- -------
6911
- TrainingCoursesGetTrainingCoursesResponseBody
6912
- OK response.
6913
-
6914
- Examples
6915
- --------
6916
- import asyncio
6917
-
6918
- from samsara import AsyncSamsara
6919
-
6920
- client = AsyncSamsara(
6921
- token="YOUR_TOKEN",
6922
- )
6923
-
6924
-
6925
- async def main() -> None:
6926
- await client.beta_ap_is.get_training_courses()
6927
-
6928
-
6929
- asyncio.run(main())
6930
- """
6931
- _response = await self._raw_client.get_training_courses(
6932
- after=after,
6933
- course_ids=course_ids,
6934
- category_ids=category_ids,
6935
- status=status,
6936
- request_options=request_options,
6937
- )
6938
- return _response.data