unique_sdk 0.10.23__tar.gz → 0.10.24__tar.gz

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 (43) hide show
  1. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/CHANGELOG.md +3 -0
  2. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/PKG-INFO +47 -1
  3. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/README.md +43 -0
  4. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/pyproject.toml +1 -1
  5. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/api_resources/_folder.py +89 -0
  6. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/LICENSE +0 -0
  7. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/__init__.py +0 -0
  8. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/_api_requestor.py +0 -0
  9. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/_api_resource.py +0 -0
  10. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/_api_version.py +0 -0
  11. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/_error.py +0 -0
  12. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/_http_client.py +0 -0
  13. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/_list_object.py +0 -0
  14. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/_object_classes.py +0 -0
  15. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/_request_options.py +0 -0
  16. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/_unique_object.py +0 -0
  17. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/_unique_ql.py +0 -0
  18. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/_unique_response.py +0 -0
  19. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/_util.py +0 -0
  20. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/_version.py +0 -0
  21. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/_webhook.py +0 -0
  22. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/api_resources/__init__.py +0 -0
  23. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/api_resources/_acronyms.py +0 -0
  24. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/api_resources/_agentic_table.py +0 -0
  25. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/api_resources/_chat_completion.py +0 -0
  26. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/api_resources/_content.py +0 -0
  27. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/api_resources/_embedding.py +0 -0
  28. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/api_resources/_event.py +0 -0
  29. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/api_resources/_integrated.py +0 -0
  30. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/api_resources/_mcp.py +0 -0
  31. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/api_resources/_message.py +0 -0
  32. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/api_resources/_message_assessment.py +0 -0
  33. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/api_resources/_message_execution.py +0 -0
  34. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/api_resources/_message_log.py +0 -0
  35. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/api_resources/_search.py +0 -0
  36. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/api_resources/_search_string.py +0 -0
  37. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/api_resources/_short_term_memory.py +0 -0
  38. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/api_resources/_space.py +0 -0
  39. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/utils/chat_history.py +0 -0
  40. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/utils/chat_in_space.py +0 -0
  41. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/utils/file_io.py +0 -0
  42. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/utils/sources.py +0 -0
  43. {unique_sdk-0.10.23 → unique_sdk-0.10.24}/unique_sdk/utils/token.py +0 -0
@@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.10.24] - 2025-09-17
9
+ - Add function to update a folder.
10
+
8
11
  ## [0.10.23] - 2025-09-12
9
12
  - Revert to using default reasoning effort.
10
13
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unique_sdk
3
- Version: 0.10.23
3
+ Version: 0.10.24
4
4
  Summary:
5
5
  License: MIT
6
6
  Author: Martin Fadler
@@ -1143,6 +1143,49 @@ unique_sdk.Folder.remove_access(
1143
1143
  )
1144
1144
  ```
1145
1145
 
1146
+ #### `unique_sdk.Folder.update`
1147
+ Uupdate a folder specified by its `scopeId` or path. The following properties can be updated:
1148
+ - parent folder - move the folder to a new parent folder specified by its `scopeId` or path. If the new parent folder is the root folder, the `parentId` should be explicitly specificed by setting `newParentId` to `None`.
1149
+ - name - update the name by setting the `name` field to the new name.
1150
+
1151
+ Examples:
1152
+
1153
+ Move the folder specified by its `scopeId` to a new parent folder specified by its path.
1154
+
1155
+ ```python
1156
+ unique_sdk.Folder.update(
1157
+ user_id=user_id,
1158
+ company_id=company_id,
1159
+ scopeId="scope_dwekjnf3330woioppm",
1160
+ parentFolderPath="/Company/folder1/folder2"
1161
+ )
1162
+ ```
1163
+
1164
+ Move the parent of a folder specified by its path to a new parent folder specified by its `scopeId` and update the name to "January".
1165
+
1166
+ ```python
1167
+ unique_sdk.Folder.update(
1168
+ user_id=user_id,
1169
+ company_id=company_id,
1170
+ folderPath="/Company/folder1",
1171
+ parentId="scope_dweekjrfhirtuhgroppm",
1172
+ name="January"
1173
+ )
1174
+ ```
1175
+
1176
+ Move the parent of a folder specified by its path to the root folder and update the name to "January".
1177
+
1178
+ ```python
1179
+ unique_sdk.Folder.update(
1180
+ user_id=user_id,
1181
+ company_id=company_id,
1182
+ folderPath="/Company/folder1",
1183
+ parentId=None,
1184
+ name="January"
1185
+ )
1186
+ ```
1187
+
1188
+
1146
1189
  #### `unique_sdk.Folder.delete` (Compatible with release >.36)
1147
1190
 
1148
1191
  Given a `scopeId` or `folderPath`, the function deletes the folder. If the folder is not empty or if the user has no WRITE access, the delete will fail.
@@ -1582,6 +1625,9 @@ All notable changes to this project will be documented in this file.
1582
1625
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1583
1626
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
1584
1627
 
1628
+ ## [0.10.24] - 2025-09-17
1629
+ - Add function to update a folder.
1630
+
1585
1631
  ## [0.10.23] - 2025-09-12
1586
1632
  - Revert to using default reasoning effort.
1587
1633
 
@@ -1125,6 +1125,49 @@ unique_sdk.Folder.remove_access(
1125
1125
  )
1126
1126
  ```
1127
1127
 
1128
+ #### `unique_sdk.Folder.update`
1129
+ Uupdate a folder specified by its `scopeId` or path. The following properties can be updated:
1130
+ - parent folder - move the folder to a new parent folder specified by its `scopeId` or path. If the new parent folder is the root folder, the `parentId` should be explicitly specificed by setting `newParentId` to `None`.
1131
+ - name - update the name by setting the `name` field to the new name.
1132
+
1133
+ Examples:
1134
+
1135
+ Move the folder specified by its `scopeId` to a new parent folder specified by its path.
1136
+
1137
+ ```python
1138
+ unique_sdk.Folder.update(
1139
+ user_id=user_id,
1140
+ company_id=company_id,
1141
+ scopeId="scope_dwekjnf3330woioppm",
1142
+ parentFolderPath="/Company/folder1/folder2"
1143
+ )
1144
+ ```
1145
+
1146
+ Move the parent of a folder specified by its path to a new parent folder specified by its `scopeId` and update the name to "January".
1147
+
1148
+ ```python
1149
+ unique_sdk.Folder.update(
1150
+ user_id=user_id,
1151
+ company_id=company_id,
1152
+ folderPath="/Company/folder1",
1153
+ parentId="scope_dweekjrfhirtuhgroppm",
1154
+ name="January"
1155
+ )
1156
+ ```
1157
+
1158
+ Move the parent of a folder specified by its path to the root folder and update the name to "January".
1159
+
1160
+ ```python
1161
+ unique_sdk.Folder.update(
1162
+ user_id=user_id,
1163
+ company_id=company_id,
1164
+ folderPath="/Company/folder1",
1165
+ parentId=None,
1166
+ name="January"
1167
+ )
1168
+ ```
1169
+
1170
+
1128
1171
  #### `unique_sdk.Folder.delete` (Compatible with release >.36)
1129
1172
 
1130
1173
  Given a `scopeId` or `folderPath`, the function deletes the folder. If the folder is not empty or if the user has no WRITE access, the delete will fail.
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "unique_sdk"
3
- version = "0.10.23"
3
+ version = "0.10.24"
4
4
  description = ""
5
5
  authors = [
6
6
  "Martin Fadler <martin.fadler@unique.ch>",
@@ -152,6 +152,17 @@ class Folder(APIResource["Folder"]):
152
152
  scopeId: str | None = None
153
153
  folderPath: str | None = None
154
154
 
155
+ class UpdateParams(RequestOptions):
156
+ """
157
+ Parameters for updating a folder.
158
+ """
159
+
160
+ scopeId: NotRequired[str]
161
+ folderPath: NotRequired[str]
162
+ parentFolderPath: NotRequired[str]
163
+ parentId: NotRequired[str]
164
+ name: NotRequired[str]
165
+
155
166
  class GetInfosParams(RequestOptions):
156
167
  """
157
168
  Parameters for getting multiple paginated folders by their parent Id.
@@ -407,6 +418,84 @@ class Folder(APIResource["Folder"]):
407
418
  ),
408
419
  )
409
420
 
421
+ @classmethod
422
+ def update(
423
+ cls,
424
+ user_id: str,
425
+ company_id: str,
426
+ **params: Unpack["Folder.UpdateParams"],
427
+ ) -> "Folder.FolderInfo":
428
+ """
429
+ Update a folder given its id or path. Can update the name or the parent folder by specifying its id or path.
430
+ """
431
+
432
+ scopeId = cls.resolve_scope_id_from_folder_path(
433
+ user_id=user_id,
434
+ company_id=company_id,
435
+ scope_id=params.get("scopeId"),
436
+ folder_path=params.get("folderPath"),
437
+ )
438
+ parentId = cls.resolve_scope_id_from_folder_path(
439
+ user_id=user_id,
440
+ company_id=company_id,
441
+ scope_id=params.get("parentId"),
442
+ folder_path=params.get("parentFolderPath"),
443
+ )
444
+ params.pop("folderPath", None)
445
+ params.pop("parentFolderPath", None)
446
+ if parentId:
447
+ params["parentId"] = parentId
448
+
449
+ return cast(
450
+ "Folder.FolderInfo",
451
+ cls._static_request(
452
+ "patch",
453
+ f"{cls.RESOURCE_URL}/{scopeId}",
454
+ user_id,
455
+ company_id=company_id,
456
+ params=params,
457
+ ),
458
+ )
459
+
460
+ @classmethod
461
+ async def update_async(
462
+ cls,
463
+ user_id: str,
464
+ company_id: str,
465
+ **params: Unpack["Folder.UpdateParams"],
466
+ ) -> "Folder.FolderInfo":
467
+ """
468
+ Async update a folder given its id or path. Can update the name or the parent folder by specifying its id or path.
469
+ """
470
+
471
+ scopeId = cls.resolve_scope_id_from_folder_path(
472
+ user_id=user_id,
473
+ company_id=company_id,
474
+ scope_id=params.get("scopeId"),
475
+ folder_path=params.get("folderPath"),
476
+ )
477
+ parentId = cls.resolve_scope_id_from_folder_path(
478
+ user_id=user_id,
479
+ company_id=company_id,
480
+ scope_id=params.get("parentId"),
481
+ folder_path=params.get("parentFolderPath"),
482
+ )
483
+ params.pop("folderPath", None)
484
+ params.pop("parentFolderPath", None)
485
+ if parentId:
486
+ params["parentId"] = parentId
487
+
488
+ return cast(
489
+ "Folder.FolderInfo",
490
+ await cls._static_request_async(
491
+ "patch",
492
+ f"{cls.RESOURCE_URL}/{scopeId}",
493
+ user_id,
494
+ company_id=company_id,
495
+ params=params,
496
+ ),
497
+ )
498
+
410
499
  @classmethod
411
500
  def delete(
412
501
  cls,
File without changes