unique_sdk 0.10.23__tar.gz → 0.10.25__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.
Potentially problematic release.
This version of unique_sdk might be problematic. Click here for more details.
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/CHANGELOG.md +6 -0
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/PKG-INFO +92 -6
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/README.md +85 -5
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/pyproject.toml +1 -1
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/api_resources/_content.py +77 -14
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/api_resources/_folder.py +94 -22
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/LICENSE +0 -0
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/__init__.py +0 -0
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/_api_requestor.py +0 -0
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/_api_resource.py +0 -0
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/_api_version.py +0 -0
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/_error.py +0 -0
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/_http_client.py +0 -0
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/_list_object.py +0 -0
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/_object_classes.py +0 -0
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/_request_options.py +0 -0
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/_unique_object.py +0 -0
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/_unique_ql.py +0 -0
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/_unique_response.py +0 -0
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/_util.py +0 -0
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/_version.py +0 -0
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/_webhook.py +0 -0
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/api_resources/__init__.py +0 -0
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/api_resources/_acronyms.py +0 -0
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/api_resources/_agentic_table.py +0 -0
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/api_resources/_chat_completion.py +0 -0
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/api_resources/_embedding.py +0 -0
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/api_resources/_event.py +0 -0
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/api_resources/_integrated.py +0 -0
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/api_resources/_mcp.py +0 -0
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/api_resources/_message.py +0 -0
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/api_resources/_message_assessment.py +0 -0
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/api_resources/_message_execution.py +0 -0
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/api_resources/_message_log.py +0 -0
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/api_resources/_search.py +0 -0
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/api_resources/_search_string.py +0 -0
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/api_resources/_short_term_memory.py +0 -0
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/api_resources/_space.py +0 -0
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/utils/chat_history.py +0 -0
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/utils/chat_in_space.py +0 -0
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/utils/file_io.py +0 -0
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/utils/sources.py +0 -0
- {unique_sdk-0.10.23 → unique_sdk-0.10.25}/unique_sdk/utils/token.py +0 -0
|
@@ -5,6 +5,12 @@ 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.25] - 2025-09-18
|
|
9
|
+
- Add support for udpate and delete files by file or folder path.
|
|
10
|
+
|
|
11
|
+
## [0.10.24] - 2025-09-17
|
|
12
|
+
- Add function to update a folder.
|
|
13
|
+
|
|
8
14
|
## [0.10.23] - 2025-09-12
|
|
9
15
|
- Revert to using default reasoning effort.
|
|
10
16
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: unique_sdk
|
|
3
|
-
Version: 0.10.
|
|
3
|
+
Version: 0.10.25
|
|
4
4
|
Summary:
|
|
5
5
|
License: MIT
|
|
6
6
|
Author: Martin Fadler
|
|
@@ -558,21 +558,34 @@ Allows you to ingest a magic table sheet, each row is processed and converted in
|
|
|
558
558
|
|
|
559
559
|
#### `unique_sdk.Content.update` (Compatible with release >.36)
|
|
560
560
|
|
|
561
|
-
Allows you to update a file specified by its `contentId`.
|
|
561
|
+
Allows you to update a file specified by its `contentId` or by its `filePath`.
|
|
562
562
|
|
|
563
|
-
- `contentId` the id of the file to be updated
|
|
563
|
+
- `contentId` optional if `filePath` is provided, the id of the file to be updated
|
|
564
|
+
- `filePath` optional if `contentId` is provided, the absolute path of the file to be updated
|
|
564
565
|
|
|
565
566
|
Currently, the following updates are supported:
|
|
566
567
|
|
|
567
568
|
Title update:
|
|
568
569
|
- `title` optional, allows updating the title of the file
|
|
569
570
|
|
|
570
|
-
Move the file to a different folder.
|
|
571
|
-
- `ownerId` optional, allows moving the file to a different folder. Represents the new folder for the file and it should be the id of a folder e.g.: `scope_dhjfieurfloakmdle`.
|
|
571
|
+
Move the file to a different folder. This can be done by specifying either the `ownerId` or the `parentFolderPath`.
|
|
572
|
+
- `ownerId` optional, allows moving the file to a different folder. Represents the new folder for the file and it should be the id of a folder e.g.: `scope_dhjfieurfloakmdle`.
|
|
573
|
+
- `parentFolderPath` optional, allows moving the file to a different folder. Represents the path new folder for the file.
|
|
572
574
|
|
|
573
575
|
Metadata update:
|
|
574
576
|
- `metadata` optional, allows updating the metadata of the file. Default metadata can not be ovrriden. (Available with release >.40)
|
|
575
577
|
|
|
578
|
+
Example of updating the title of a file specified by its path.
|
|
579
|
+
|
|
580
|
+
```python
|
|
581
|
+
unique_sdk.Content.update(
|
|
582
|
+
user_id=user_id,
|
|
583
|
+
company_id=company_id,
|
|
584
|
+
filePath="/Company/finance/january.xls",
|
|
585
|
+
title="Revision Deck"
|
|
586
|
+
)
|
|
587
|
+
```
|
|
588
|
+
|
|
576
589
|
Example of moving a file specified by its content id.
|
|
577
590
|
|
|
578
591
|
```python
|
|
@@ -599,12 +612,25 @@ unique_sdk.Content.update(
|
|
|
599
612
|
)
|
|
600
613
|
```
|
|
601
614
|
|
|
615
|
+
Example of moving a file to a folder specified by its path.
|
|
616
|
+
|
|
617
|
+
```python
|
|
618
|
+
unique_sdk.Content.update(
|
|
619
|
+
user_id=user_id,
|
|
620
|
+
company_id=company_id,
|
|
621
|
+
contentId="cont_ok2343q5owbce80w78hudawu5",
|
|
622
|
+
ownerId="scope_e68yz5asho7glfh7c7d041el",
|
|
623
|
+
parentFolderPath="/Company/Revisions"
|
|
624
|
+
)
|
|
625
|
+
```
|
|
626
|
+
|
|
602
627
|
#### `unique_sdk.Content.delete` (Compatible with release >.36)
|
|
603
628
|
|
|
604
629
|
Allows you to delete a file by its `contentId`. If the file is part of a chat, the `chatId` also needs do be set.
|
|
605
630
|
|
|
606
|
-
- `contentId` the id of the file to be deleted
|
|
631
|
+
- `contentId` optional if `filePath` is provided, the id of the file to be deleted
|
|
607
632
|
- `chatId` optional, the id of the chat where the file is. Only needed if the file is part of a chat
|
|
633
|
+
- `filePath` optional if `contentId` is provided, the absolute path of the file to be deleted
|
|
608
634
|
|
|
609
635
|
Example of deleting a file from a chat.
|
|
610
636
|
|
|
@@ -617,6 +643,17 @@ unique_sdk.Content.delete(
|
|
|
617
643
|
)
|
|
618
644
|
```
|
|
619
645
|
|
|
646
|
+
Example of deleting a file by its path.
|
|
647
|
+
|
|
648
|
+
```python
|
|
649
|
+
unique_sdk.Content.delete(
|
|
650
|
+
user_id=user_id,
|
|
651
|
+
company_id=company_id,
|
|
652
|
+
filePath="/Company/finance/january.xls",
|
|
653
|
+
)
|
|
654
|
+
```
|
|
655
|
+
|
|
656
|
+
|
|
620
657
|
### Message
|
|
621
658
|
|
|
622
659
|
#### `unique_sdk.Message.list`
|
|
@@ -1143,6 +1180,49 @@ unique_sdk.Folder.remove_access(
|
|
|
1143
1180
|
)
|
|
1144
1181
|
```
|
|
1145
1182
|
|
|
1183
|
+
#### `unique_sdk.Folder.update`
|
|
1184
|
+
Uupdate a folder specified by its `scopeId` or path. The following properties can be updated:
|
|
1185
|
+
- 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`.
|
|
1186
|
+
- name - update the name by setting the `name` field to the new name.
|
|
1187
|
+
|
|
1188
|
+
Examples:
|
|
1189
|
+
|
|
1190
|
+
Move the folder specified by its `scopeId` to a new parent folder specified by its path.
|
|
1191
|
+
|
|
1192
|
+
```python
|
|
1193
|
+
unique_sdk.Folder.update(
|
|
1194
|
+
user_id=user_id,
|
|
1195
|
+
company_id=company_id,
|
|
1196
|
+
scopeId="scope_dwekjnf3330woioppm",
|
|
1197
|
+
parentFolderPath="/Company/folder1/folder2"
|
|
1198
|
+
)
|
|
1199
|
+
```
|
|
1200
|
+
|
|
1201
|
+
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".
|
|
1202
|
+
|
|
1203
|
+
```python
|
|
1204
|
+
unique_sdk.Folder.update(
|
|
1205
|
+
user_id=user_id,
|
|
1206
|
+
company_id=company_id,
|
|
1207
|
+
folderPath="/Company/folder1",
|
|
1208
|
+
parentId="scope_dweekjrfhirtuhgroppm",
|
|
1209
|
+
name="January"
|
|
1210
|
+
)
|
|
1211
|
+
```
|
|
1212
|
+
|
|
1213
|
+
Move the parent of a folder specified by its path to the root folder and update the name to "January".
|
|
1214
|
+
|
|
1215
|
+
```python
|
|
1216
|
+
unique_sdk.Folder.update(
|
|
1217
|
+
user_id=user_id,
|
|
1218
|
+
company_id=company_id,
|
|
1219
|
+
folderPath="/Company/folder1",
|
|
1220
|
+
parentId=None,
|
|
1221
|
+
name="January"
|
|
1222
|
+
)
|
|
1223
|
+
```
|
|
1224
|
+
|
|
1225
|
+
|
|
1146
1226
|
#### `unique_sdk.Folder.delete` (Compatible with release >.36)
|
|
1147
1227
|
|
|
1148
1228
|
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 +1662,12 @@ All notable changes to this project will be documented in this file.
|
|
|
1582
1662
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
1583
1663
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
1584
1664
|
|
|
1665
|
+
## [0.10.25] - 2025-09-18
|
|
1666
|
+
- Add support for udpate and delete files by file or folder path.
|
|
1667
|
+
|
|
1668
|
+
## [0.10.24] - 2025-09-17
|
|
1669
|
+
- Add function to update a folder.
|
|
1670
|
+
|
|
1585
1671
|
## [0.10.23] - 2025-09-12
|
|
1586
1672
|
- Revert to using default reasoning effort.
|
|
1587
1673
|
|
|
@@ -540,21 +540,34 @@ Allows you to ingest a magic table sheet, each row is processed and converted in
|
|
|
540
540
|
|
|
541
541
|
#### `unique_sdk.Content.update` (Compatible with release >.36)
|
|
542
542
|
|
|
543
|
-
Allows you to update a file specified by its `contentId`.
|
|
543
|
+
Allows you to update a file specified by its `contentId` or by its `filePath`.
|
|
544
544
|
|
|
545
|
-
- `contentId` the id of the file to be updated
|
|
545
|
+
- `contentId` optional if `filePath` is provided, the id of the file to be updated
|
|
546
|
+
- `filePath` optional if `contentId` is provided, the absolute path of the file to be updated
|
|
546
547
|
|
|
547
548
|
Currently, the following updates are supported:
|
|
548
549
|
|
|
549
550
|
Title update:
|
|
550
551
|
- `title` optional, allows updating the title of the file
|
|
551
552
|
|
|
552
|
-
Move the file to a different folder.
|
|
553
|
-
- `ownerId` optional, allows moving the file to a different folder. Represents the new folder for the file and it should be the id of a folder e.g.: `scope_dhjfieurfloakmdle`.
|
|
553
|
+
Move the file to a different folder. This can be done by specifying either the `ownerId` or the `parentFolderPath`.
|
|
554
|
+
- `ownerId` optional, allows moving the file to a different folder. Represents the new folder for the file and it should be the id of a folder e.g.: `scope_dhjfieurfloakmdle`.
|
|
555
|
+
- `parentFolderPath` optional, allows moving the file to a different folder. Represents the path new folder for the file.
|
|
554
556
|
|
|
555
557
|
Metadata update:
|
|
556
558
|
- `metadata` optional, allows updating the metadata of the file. Default metadata can not be ovrriden. (Available with release >.40)
|
|
557
559
|
|
|
560
|
+
Example of updating the title of a file specified by its path.
|
|
561
|
+
|
|
562
|
+
```python
|
|
563
|
+
unique_sdk.Content.update(
|
|
564
|
+
user_id=user_id,
|
|
565
|
+
company_id=company_id,
|
|
566
|
+
filePath="/Company/finance/january.xls",
|
|
567
|
+
title="Revision Deck"
|
|
568
|
+
)
|
|
569
|
+
```
|
|
570
|
+
|
|
558
571
|
Example of moving a file specified by its content id.
|
|
559
572
|
|
|
560
573
|
```python
|
|
@@ -581,12 +594,25 @@ unique_sdk.Content.update(
|
|
|
581
594
|
)
|
|
582
595
|
```
|
|
583
596
|
|
|
597
|
+
Example of moving a file to a folder specified by its path.
|
|
598
|
+
|
|
599
|
+
```python
|
|
600
|
+
unique_sdk.Content.update(
|
|
601
|
+
user_id=user_id,
|
|
602
|
+
company_id=company_id,
|
|
603
|
+
contentId="cont_ok2343q5owbce80w78hudawu5",
|
|
604
|
+
ownerId="scope_e68yz5asho7glfh7c7d041el",
|
|
605
|
+
parentFolderPath="/Company/Revisions"
|
|
606
|
+
)
|
|
607
|
+
```
|
|
608
|
+
|
|
584
609
|
#### `unique_sdk.Content.delete` (Compatible with release >.36)
|
|
585
610
|
|
|
586
611
|
Allows you to delete a file by its `contentId`. If the file is part of a chat, the `chatId` also needs do be set.
|
|
587
612
|
|
|
588
|
-
- `contentId` the id of the file to be deleted
|
|
613
|
+
- `contentId` optional if `filePath` is provided, the id of the file to be deleted
|
|
589
614
|
- `chatId` optional, the id of the chat where the file is. Only needed if the file is part of a chat
|
|
615
|
+
- `filePath` optional if `contentId` is provided, the absolute path of the file to be deleted
|
|
590
616
|
|
|
591
617
|
Example of deleting a file from a chat.
|
|
592
618
|
|
|
@@ -599,6 +625,17 @@ unique_sdk.Content.delete(
|
|
|
599
625
|
)
|
|
600
626
|
```
|
|
601
627
|
|
|
628
|
+
Example of deleting a file by its path.
|
|
629
|
+
|
|
630
|
+
```python
|
|
631
|
+
unique_sdk.Content.delete(
|
|
632
|
+
user_id=user_id,
|
|
633
|
+
company_id=company_id,
|
|
634
|
+
filePath="/Company/finance/january.xls",
|
|
635
|
+
)
|
|
636
|
+
```
|
|
637
|
+
|
|
638
|
+
|
|
602
639
|
### Message
|
|
603
640
|
|
|
604
641
|
#### `unique_sdk.Message.list`
|
|
@@ -1125,6 +1162,49 @@ unique_sdk.Folder.remove_access(
|
|
|
1125
1162
|
)
|
|
1126
1163
|
```
|
|
1127
1164
|
|
|
1165
|
+
#### `unique_sdk.Folder.update`
|
|
1166
|
+
Uupdate a folder specified by its `scopeId` or path. The following properties can be updated:
|
|
1167
|
+
- 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`.
|
|
1168
|
+
- name - update the name by setting the `name` field to the new name.
|
|
1169
|
+
|
|
1170
|
+
Examples:
|
|
1171
|
+
|
|
1172
|
+
Move the folder specified by its `scopeId` to a new parent folder specified by its path.
|
|
1173
|
+
|
|
1174
|
+
```python
|
|
1175
|
+
unique_sdk.Folder.update(
|
|
1176
|
+
user_id=user_id,
|
|
1177
|
+
company_id=company_id,
|
|
1178
|
+
scopeId="scope_dwekjnf3330woioppm",
|
|
1179
|
+
parentFolderPath="/Company/folder1/folder2"
|
|
1180
|
+
)
|
|
1181
|
+
```
|
|
1182
|
+
|
|
1183
|
+
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".
|
|
1184
|
+
|
|
1185
|
+
```python
|
|
1186
|
+
unique_sdk.Folder.update(
|
|
1187
|
+
user_id=user_id,
|
|
1188
|
+
company_id=company_id,
|
|
1189
|
+
folderPath="/Company/folder1",
|
|
1190
|
+
parentId="scope_dweekjrfhirtuhgroppm",
|
|
1191
|
+
name="January"
|
|
1192
|
+
)
|
|
1193
|
+
```
|
|
1194
|
+
|
|
1195
|
+
Move the parent of a folder specified by its path to the root folder and update the name to "January".
|
|
1196
|
+
|
|
1197
|
+
```python
|
|
1198
|
+
unique_sdk.Folder.update(
|
|
1199
|
+
user_id=user_id,
|
|
1200
|
+
company_id=company_id,
|
|
1201
|
+
folderPath="/Company/folder1",
|
|
1202
|
+
parentId=None,
|
|
1203
|
+
name="January"
|
|
1204
|
+
)
|
|
1205
|
+
```
|
|
1206
|
+
|
|
1207
|
+
|
|
1128
1208
|
#### `unique_sdk.Folder.delete` (Compatible with release >.36)
|
|
1129
1209
|
|
|
1130
1210
|
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.
|
|
@@ -12,6 +12,7 @@ from typing import (
|
|
|
12
12
|
|
|
13
13
|
from typing_extensions import NotRequired, Unpack
|
|
14
14
|
|
|
15
|
+
import unique_sdk
|
|
15
16
|
from unique_sdk._api_resource import APIResource
|
|
16
17
|
from unique_sdk._request_options import RequestOptions
|
|
17
18
|
|
|
@@ -81,7 +82,7 @@ class Content(APIResource["Content"]):
|
|
|
81
82
|
This is used to retrieve information about content based on various filters.
|
|
82
83
|
"""
|
|
83
84
|
|
|
84
|
-
metadataFilter: dict
|
|
85
|
+
metadataFilter: NotRequired[dict]
|
|
85
86
|
skip: NotRequired[int]
|
|
86
87
|
take: NotRequired[int]
|
|
87
88
|
filePath: NotRequired[str]
|
|
@@ -117,7 +118,7 @@ class Content(APIResource["Content"]):
|
|
|
117
118
|
ownerId: str
|
|
118
119
|
byteSize: Optional[int]
|
|
119
120
|
ingestionConfig: "Content.IngestionConfig"
|
|
120
|
-
metadata: dict[str,
|
|
121
|
+
metadata: NotRequired[dict[str, str | None]]
|
|
121
122
|
|
|
122
123
|
class UpsertParams(RequestOptions):
|
|
123
124
|
input: "Content.Input"
|
|
@@ -129,7 +130,9 @@ class Content(APIResource["Content"]):
|
|
|
129
130
|
|
|
130
131
|
class UpdateParams(RequestOptions):
|
|
131
132
|
contentId: NotRequired[str]
|
|
133
|
+
filePath: NotRequired[str]
|
|
132
134
|
ownerId: NotRequired[str]
|
|
135
|
+
parentFolderPath: NotRequired[str]
|
|
133
136
|
title: NotRequired[str]
|
|
134
137
|
metadata: NotRequired[dict[str, str | None]]
|
|
135
138
|
|
|
@@ -161,11 +164,16 @@ class Content(APIResource["Content"]):
|
|
|
161
164
|
expiredAt: str | None
|
|
162
165
|
|
|
163
166
|
class PaginatedContentInfo(TypedDict):
|
|
167
|
+
contentInfo: List["Content.ContentInfo"]
|
|
168
|
+
totalCount: int
|
|
169
|
+
|
|
170
|
+
class PaginatedContentInfos(TypedDict):
|
|
164
171
|
contentInfos: List["Content.ContentInfo"]
|
|
165
172
|
totalCount: int
|
|
166
173
|
|
|
167
174
|
class DeleteParams(RequestOptions):
|
|
168
175
|
contentId: NotRequired[str]
|
|
176
|
+
filePath: NotRequired[str]
|
|
169
177
|
chatId: NotRequired[str]
|
|
170
178
|
|
|
171
179
|
class DeleteResponse(TypedDict):
|
|
@@ -284,9 +292,9 @@ class Content(APIResource["Content"]):
|
|
|
284
292
|
user_id: str,
|
|
285
293
|
company_id: str,
|
|
286
294
|
**params: Unpack["Content.ContentInfoParams"],
|
|
287
|
-
) -> "Content.
|
|
295
|
+
) -> "Content.PaginatedContentInfos":
|
|
288
296
|
return cast(
|
|
289
|
-
Content.
|
|
297
|
+
Content.PaginatedContentInfos,
|
|
290
298
|
cls._static_request(
|
|
291
299
|
"post",
|
|
292
300
|
"/content/infos",
|
|
@@ -302,9 +310,9 @@ class Content(APIResource["Content"]):
|
|
|
302
310
|
user_id: str,
|
|
303
311
|
company_id: str,
|
|
304
312
|
**params: Unpack["Content.ContentInfoParams"],
|
|
305
|
-
) -> "Content.
|
|
313
|
+
) -> "Content.PaginatedContentInfos":
|
|
306
314
|
return cast(
|
|
307
|
-
Content.
|
|
315
|
+
Content.PaginatedContentInfos,
|
|
308
316
|
await cls._static_request_async(
|
|
309
317
|
"post",
|
|
310
318
|
"/content/infos",
|
|
@@ -403,11 +411,29 @@ class Content(APIResource["Content"]):
|
|
|
403
411
|
company_id: str,
|
|
404
412
|
**params: Unpack["Content.UpdateParams"],
|
|
405
413
|
) -> "Content.ContentInfo":
|
|
414
|
+
content_id = cls.resolve_content_id_from_file_path(
|
|
415
|
+
user_id=user_id,
|
|
416
|
+
company_id=company_id,
|
|
417
|
+
content_id=params.get("contentId"),
|
|
418
|
+
file_path=params.get("filePath"),
|
|
419
|
+
)
|
|
420
|
+
owner_id = unique_sdk.Folder.resolve_scope_id_from_folder_path(
|
|
421
|
+
user_id,
|
|
422
|
+
company_id,
|
|
423
|
+
params.get("ownerId"),
|
|
424
|
+
params.get("parentFolderPath"),
|
|
425
|
+
)
|
|
426
|
+
params.pop("contentId", None)
|
|
427
|
+
params.pop("filePath", None)
|
|
428
|
+
params.pop("parentFolderPath", None)
|
|
429
|
+
if owner_id is not None:
|
|
430
|
+
params["ownerId"] = owner_id
|
|
431
|
+
|
|
406
432
|
return cast(
|
|
407
433
|
"Content.ContentInfo",
|
|
408
434
|
cls._static_request(
|
|
409
435
|
"patch",
|
|
410
|
-
f"/content/{
|
|
436
|
+
f"/content/{content_id}",
|
|
411
437
|
user_id,
|
|
412
438
|
company_id,
|
|
413
439
|
params=params,
|
|
@@ -421,11 +447,29 @@ class Content(APIResource["Content"]):
|
|
|
421
447
|
company_id: str,
|
|
422
448
|
**params: Unpack["Content.UpdateParams"],
|
|
423
449
|
) -> "Content.ContentInfo":
|
|
450
|
+
content_id = cls.resolve_content_id_from_file_path(
|
|
451
|
+
user_id,
|
|
452
|
+
company_id,
|
|
453
|
+
params.get("contentId"),
|
|
454
|
+
params.get("filePath"),
|
|
455
|
+
)
|
|
456
|
+
owner_id = unique_sdk.Folder.resolve_scope_id_from_folder_path(
|
|
457
|
+
user_id,
|
|
458
|
+
company_id,
|
|
459
|
+
params.get("ownerId"),
|
|
460
|
+
params.get("parentFolderPath"),
|
|
461
|
+
)
|
|
462
|
+
params.pop("contentId", None)
|
|
463
|
+
params.pop("filePath", None)
|
|
464
|
+
params.pop("parentFolderPath", None)
|
|
465
|
+
if owner_id is not None:
|
|
466
|
+
params["ownerId"] = owner_id
|
|
467
|
+
|
|
424
468
|
return cast(
|
|
425
469
|
"Content.ContentInfo",
|
|
426
470
|
await cls._static_request_async(
|
|
427
471
|
"patch",
|
|
428
|
-
f"/content/{
|
|
472
|
+
f"/content/{content_id}",
|
|
429
473
|
user_id,
|
|
430
474
|
company_id,
|
|
431
475
|
params=params,
|
|
@@ -437,17 +481,25 @@ class Content(APIResource["Content"]):
|
|
|
437
481
|
cls,
|
|
438
482
|
user_id: str,
|
|
439
483
|
company_id: str,
|
|
440
|
-
**params: "Content.DeleteParams",
|
|
484
|
+
**params: Unpack["Content.DeleteParams"],
|
|
441
485
|
) -> "Content.DeleteResponse":
|
|
442
486
|
"""
|
|
443
487
|
Deletes a content by its id or file path.
|
|
444
488
|
"""
|
|
489
|
+
content_id = cls.resolve_content_id_from_file_path(
|
|
490
|
+
user_id,
|
|
491
|
+
company_id,
|
|
492
|
+
params.get("contentId"),
|
|
493
|
+
params.get("filePath"),
|
|
494
|
+
)
|
|
495
|
+
params.pop("contentId", None)
|
|
496
|
+
params.pop("filePath", None)
|
|
445
497
|
|
|
446
498
|
return cast(
|
|
447
499
|
"Content.DeleteResponse",
|
|
448
500
|
cls._static_request(
|
|
449
501
|
"delete",
|
|
450
|
-
f"/content/{
|
|
502
|
+
f"/content/{content_id}",
|
|
451
503
|
user_id,
|
|
452
504
|
company_id,
|
|
453
505
|
params=params,
|
|
@@ -459,17 +511,25 @@ class Content(APIResource["Content"]):
|
|
|
459
511
|
cls,
|
|
460
512
|
user_id: str,
|
|
461
513
|
company_id: str,
|
|
462
|
-
**params: "Content.DeleteParams",
|
|
514
|
+
**params: Unpack["Content.DeleteParams"],
|
|
463
515
|
) -> "Content.DeleteResponse":
|
|
464
516
|
"""
|
|
465
517
|
Async deletes a content by its id or file path.
|
|
466
518
|
"""
|
|
519
|
+
content_id = cls.resolve_content_id_from_file_path(
|
|
520
|
+
user_id,
|
|
521
|
+
company_id,
|
|
522
|
+
params.get("contentId"),
|
|
523
|
+
params.get("filePath"),
|
|
524
|
+
)
|
|
525
|
+
params.pop("contentId", None)
|
|
526
|
+
params.pop("filePath", None)
|
|
467
527
|
|
|
468
528
|
return cast(
|
|
469
529
|
"Content.DeleteResponse",
|
|
470
530
|
await cls._static_request_async(
|
|
471
531
|
"delete",
|
|
472
|
-
f"/content/{
|
|
532
|
+
f"/content/{content_id}",
|
|
473
533
|
user_id,
|
|
474
534
|
company_id,
|
|
475
535
|
params=params,
|
|
@@ -483,7 +543,7 @@ class Content(APIResource["Content"]):
|
|
|
483
543
|
company_id: str,
|
|
484
544
|
content_id: str | None = None,
|
|
485
545
|
file_path: str | None = None,
|
|
486
|
-
) -> str:
|
|
546
|
+
) -> str | None:
|
|
487
547
|
"""
|
|
488
548
|
Returns the contentId to use: if content_id is provided, returns it;
|
|
489
549
|
if not, but file_path is provided, resolves and returns the id for that file path.
|
|
@@ -496,9 +556,12 @@ class Content(APIResource["Content"]):
|
|
|
496
556
|
company_id=company_id,
|
|
497
557
|
filePath=file_path,
|
|
498
558
|
)
|
|
559
|
+
content_infos = file_info.get("contentInfo")
|
|
499
560
|
resolved_id = (
|
|
500
|
-
|
|
561
|
+
content_infos[0].get("id")
|
|
501
562
|
if file_info.get("totalCount", 0) > 0
|
|
563
|
+
and content_infos is not None
|
|
564
|
+
and len(content_infos) > 0
|
|
502
565
|
else None
|
|
503
566
|
)
|
|
504
567
|
if not resolved_id:
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
from enum import Enum
|
|
2
1
|
from typing import (
|
|
3
2
|
ClassVar,
|
|
4
3
|
List,
|
|
@@ -23,26 +22,10 @@ class Folder(APIResource["Folder"]):
|
|
|
23
22
|
Represents the access level of a scope.
|
|
24
23
|
"""
|
|
25
24
|
|
|
26
|
-
class ScopeAccessType(Enum):
|
|
27
|
-
"""
|
|
28
|
-
Enum for scope access levels.
|
|
29
|
-
"""
|
|
30
|
-
|
|
31
|
-
READ = "READ"
|
|
32
|
-
WRITE = "WRITE"
|
|
33
|
-
|
|
34
|
-
class ScopeAccessEntityType(Enum):
|
|
35
|
-
"""
|
|
36
|
-
Enum for scope access entity types.
|
|
37
|
-
"""
|
|
38
|
-
|
|
39
|
-
USER = "USER"
|
|
40
|
-
GROUP = "GROUP"
|
|
41
|
-
|
|
42
25
|
entityId: str
|
|
43
|
-
type:
|
|
44
|
-
entityType:
|
|
45
|
-
createdAt: str
|
|
26
|
+
type: Literal["READ", "WRITE"]
|
|
27
|
+
entityType: Literal["USER", "GROUP"]
|
|
28
|
+
createdAt: NotRequired[str]
|
|
46
29
|
|
|
47
30
|
class Children(TypedDict):
|
|
48
31
|
"""
|
|
@@ -149,8 +132,19 @@ class Folder(APIResource["Folder"]):
|
|
|
149
132
|
Parameters for getting a folder by its Id or path.
|
|
150
133
|
"""
|
|
151
134
|
|
|
152
|
-
scopeId: str
|
|
153
|
-
folderPath: str
|
|
135
|
+
scopeId: NotRequired[str]
|
|
136
|
+
folderPath: NotRequired[str]
|
|
137
|
+
|
|
138
|
+
class UpdateParams(RequestOptions):
|
|
139
|
+
"""
|
|
140
|
+
Parameters for updating a folder.
|
|
141
|
+
"""
|
|
142
|
+
|
|
143
|
+
scopeId: NotRequired[str]
|
|
144
|
+
folderPath: NotRequired[str]
|
|
145
|
+
parentFolderPath: NotRequired[str]
|
|
146
|
+
parentId: NotRequired[str]
|
|
147
|
+
name: NotRequired[str]
|
|
154
148
|
|
|
155
149
|
class GetInfosParams(RequestOptions):
|
|
156
150
|
"""
|
|
@@ -407,6 +401,84 @@ class Folder(APIResource["Folder"]):
|
|
|
407
401
|
),
|
|
408
402
|
)
|
|
409
403
|
|
|
404
|
+
@classmethod
|
|
405
|
+
def update(
|
|
406
|
+
cls,
|
|
407
|
+
user_id: str,
|
|
408
|
+
company_id: str,
|
|
409
|
+
**params: Unpack["Folder.UpdateParams"],
|
|
410
|
+
) -> "Folder.FolderInfo":
|
|
411
|
+
"""
|
|
412
|
+
Update a folder given its id or path. Can update the name or the parent folder by specifying its id or path.
|
|
413
|
+
"""
|
|
414
|
+
|
|
415
|
+
scopeId = cls.resolve_scope_id_from_folder_path(
|
|
416
|
+
user_id=user_id,
|
|
417
|
+
company_id=company_id,
|
|
418
|
+
scope_id=params.get("scopeId"),
|
|
419
|
+
folder_path=params.get("folderPath"),
|
|
420
|
+
)
|
|
421
|
+
parentId = cls.resolve_scope_id_from_folder_path(
|
|
422
|
+
user_id=user_id,
|
|
423
|
+
company_id=company_id,
|
|
424
|
+
scope_id=params.get("parentId"),
|
|
425
|
+
folder_path=params.get("parentFolderPath"),
|
|
426
|
+
)
|
|
427
|
+
params.pop("folderPath", None)
|
|
428
|
+
params.pop("parentFolderPath", None)
|
|
429
|
+
if parentId:
|
|
430
|
+
params["parentId"] = parentId
|
|
431
|
+
|
|
432
|
+
return cast(
|
|
433
|
+
"Folder.FolderInfo",
|
|
434
|
+
cls._static_request(
|
|
435
|
+
"patch",
|
|
436
|
+
f"{cls.RESOURCE_URL}/{scopeId}",
|
|
437
|
+
user_id,
|
|
438
|
+
company_id=company_id,
|
|
439
|
+
params=params,
|
|
440
|
+
),
|
|
441
|
+
)
|
|
442
|
+
|
|
443
|
+
@classmethod
|
|
444
|
+
async def update_async(
|
|
445
|
+
cls,
|
|
446
|
+
user_id: str,
|
|
447
|
+
company_id: str,
|
|
448
|
+
**params: Unpack["Folder.UpdateParams"],
|
|
449
|
+
) -> "Folder.FolderInfo":
|
|
450
|
+
"""
|
|
451
|
+
Async update a folder given its id or path. Can update the name or the parent folder by specifying its id or path.
|
|
452
|
+
"""
|
|
453
|
+
|
|
454
|
+
scopeId = cls.resolve_scope_id_from_folder_path(
|
|
455
|
+
user_id=user_id,
|
|
456
|
+
company_id=company_id,
|
|
457
|
+
scope_id=params.get("scopeId"),
|
|
458
|
+
folder_path=params.get("folderPath"),
|
|
459
|
+
)
|
|
460
|
+
parentId = cls.resolve_scope_id_from_folder_path(
|
|
461
|
+
user_id=user_id,
|
|
462
|
+
company_id=company_id,
|
|
463
|
+
scope_id=params.get("parentId"),
|
|
464
|
+
folder_path=params.get("parentFolderPath"),
|
|
465
|
+
)
|
|
466
|
+
params.pop("folderPath", None)
|
|
467
|
+
params.pop("parentFolderPath", None)
|
|
468
|
+
if parentId:
|
|
469
|
+
params["parentId"] = parentId
|
|
470
|
+
|
|
471
|
+
return cast(
|
|
472
|
+
"Folder.FolderInfo",
|
|
473
|
+
await cls._static_request_async(
|
|
474
|
+
"patch",
|
|
475
|
+
f"{cls.RESOURCE_URL}/{scopeId}",
|
|
476
|
+
user_id,
|
|
477
|
+
company_id=company_id,
|
|
478
|
+
params=params,
|
|
479
|
+
),
|
|
480
|
+
)
|
|
481
|
+
|
|
410
482
|
@classmethod
|
|
411
483
|
def delete(
|
|
412
484
|
cls,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|