tamar-file-hub-client 0.0.11__tar.gz → 0.1.0__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 (62) hide show
  1. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/PKG-INFO +21 -6
  2. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/README.md +20 -5
  3. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/rpc/gen/file_service_pb2.py +7 -5
  4. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/rpc/gen/file_service_pb2_grpc.py +3 -3
  5. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/rpc/protos/file_service.proto +6 -1
  6. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/schemas/__init__.py +2 -0
  7. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/schemas/file.py +6 -0
  8. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/services/file/async_file_service.py +14 -3
  9. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/services/file/sync_file_service.py +14 -3
  10. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/services/taple/async_taple_service.py +14 -2
  11. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/services/taple/base_taple_service.py +13 -1
  12. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/services/taple/sync_taple_service.py +14 -2
  13. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/setup.py +1 -1
  14. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/tamar_file_hub_client.egg-info/PKG-INFO +21 -6
  15. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/MANIFEST.in +0 -0
  16. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/__init__.py +0 -0
  17. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/client.py +0 -0
  18. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/enums/__init__.py +0 -0
  19. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/enums/export_format.py +0 -0
  20. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/enums/role.py +0 -0
  21. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/enums/upload_mode.py +0 -0
  22. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/errors/__init__.py +0 -0
  23. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/errors/exceptions.py +0 -0
  24. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/py.typed +0 -0
  25. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/rpc/__init__.py +0 -0
  26. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/rpc/async_client.py +0 -0
  27. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/rpc/gen/__init__.py +0 -0
  28. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/rpc/gen/folder_service_pb2.py +0 -0
  29. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/rpc/gen/folder_service_pb2_grpc.py +0 -0
  30. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/rpc/gen/taple_service_pb2.py +0 -0
  31. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/rpc/gen/taple_service_pb2_grpc.py +0 -0
  32. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/rpc/interceptors.py +0 -0
  33. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/rpc/protos/folder_service.proto +0 -0
  34. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/rpc/protos/taple_service.proto +0 -0
  35. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/rpc/sync_client.py +0 -0
  36. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/schemas/context.py +0 -0
  37. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/schemas/folder.py +0 -0
  38. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/schemas/taple.py +0 -0
  39. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/services/__init__.py +0 -0
  40. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/services/file/__init__.py +0 -0
  41. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/services/file/async_blob_service.py +0 -0
  42. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/services/file/base_file_service.py +0 -0
  43. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/services/file/sync_blob_service.py +0 -0
  44. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/services/folder/__init__.py +0 -0
  45. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/services/folder/async_folder_service.py +0 -0
  46. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/services/folder/sync_folder_service.py +0 -0
  47. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/services/taple/__init__.py +0 -0
  48. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/services/taple/idempotent_taple_mixin.py +0 -0
  49. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/utils/__init__.py +0 -0
  50. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/utils/converter.py +0 -0
  51. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/utils/download_helper.py +0 -0
  52. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/utils/file_utils.py +0 -0
  53. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/utils/idempotency.py +0 -0
  54. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/utils/logging.py +0 -0
  55. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/utils/retry.py +0 -0
  56. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/utils/smart_retry.py +0 -0
  57. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/file_hub_client/utils/upload_helper.py +0 -0
  58. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/setup.cfg +0 -0
  59. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/tamar_file_hub_client.egg-info/SOURCES.txt +0 -0
  60. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/tamar_file_hub_client.egg-info/dependency_links.txt +0 -0
  61. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/tamar_file_hub_client.egg-info/requires.txt +0 -0
  62. {tamar_file_hub_client-0.0.11 → tamar_file_hub_client-0.1.0}/tamar_file_hub_client.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tamar-file-hub-client
3
- Version: 0.0.11
3
+ Version: 0.1.0
4
4
  Summary: A Python SDK for gRPC-based file management system
5
5
  Home-page: https://github.com/Tamar-Edge-AI/file-hub-client
6
6
  Author: Oscar Ou
@@ -695,11 +695,23 @@ async with AsyncTamarFileHubClient() as client:
695
695
  # 设置用户上下文
696
696
  client.set_user_context(org_id="123", user_id="456")
697
697
 
698
- # 获取文件详细信息
699
- file_info = await client.files.get_file(file_id="file-001")
698
+ # 获取文件详细信息(返回 GetFileResponse 对象)
699
+ response = await client.files.get_file(file_id="file-001")
700
+
701
+ # 访问文件基本信息
702
+ file_info = response.file
703
+ print(f"文件ID: {file_info.id}")
700
704
  print(f"文件名: {file_info.file_name}")
701
- print(f"文件大小: {file_info.file_size} bytes")
705
+ print(f"文件类型: {file_info.file_type}")
702
706
  print(f"创建时间: {file_info.created_at}")
707
+
708
+ # 访问上传文件详细信息(如果存在)
709
+ if response.upload_file:
710
+ upload_info = response.upload_file
711
+ print(f"文件大小: {upload_info.file_size} bytes")
712
+ print(f"MIME类型: {upload_info.mime_type}")
713
+ print(f"存储类型: {upload_info.storage_type}")
714
+ print(f"存储路径: {upload_info.stored_path}")
703
715
  ```
704
716
 
705
717
  #### 重命名文件
@@ -1622,10 +1634,12 @@ folder = await client.folders.create_folder(
1622
1634
 
1623
1635
  # 同步客户端同样支持
1624
1636
  sync_client = TamarFileHubClient(user_context=user_context)
1625
- file_info = sync_client.files.get_file(
1637
+ response = sync_client.files.get_file(
1626
1638
  file_id="file-123",
1627
1639
  request_id="debug-get-file-001"
1628
1640
  )
1641
+ # response.file 包含文件基本信息
1642
+ # response.upload_file 包含上传文件详细信息(可能为None)
1629
1643
  ```
1630
1644
 
1631
1645
  #### 请求ID优先级
@@ -1679,7 +1693,8 @@ await minimal_client.taples.create_table(name="auto_generated")
1679
1693
  - 所有批量操作方法
1680
1694
 
1681
1695
  **文件服务**:
1682
- - `get_file()`, `rename_file()`, `delete_file()`, `list_files()`
1696
+ - `get_file()` - 返回 `GetFileResponse` 对象,包含 `file` `upload_file` 信息
1697
+ - `rename_file()`, `delete_file()`, `list_files()`
1683
1698
  - `generate_share_link()`, `visit_file()`
1684
1699
 
1685
1700
  **文件夹服务**:
@@ -649,11 +649,23 @@ async with AsyncTamarFileHubClient() as client:
649
649
  # 设置用户上下文
650
650
  client.set_user_context(org_id="123", user_id="456")
651
651
 
652
- # 获取文件详细信息
653
- file_info = await client.files.get_file(file_id="file-001")
652
+ # 获取文件详细信息(返回 GetFileResponse 对象)
653
+ response = await client.files.get_file(file_id="file-001")
654
+
655
+ # 访问文件基本信息
656
+ file_info = response.file
657
+ print(f"文件ID: {file_info.id}")
654
658
  print(f"文件名: {file_info.file_name}")
655
- print(f"文件大小: {file_info.file_size} bytes")
659
+ print(f"文件类型: {file_info.file_type}")
656
660
  print(f"创建时间: {file_info.created_at}")
661
+
662
+ # 访问上传文件详细信息(如果存在)
663
+ if response.upload_file:
664
+ upload_info = response.upload_file
665
+ print(f"文件大小: {upload_info.file_size} bytes")
666
+ print(f"MIME类型: {upload_info.mime_type}")
667
+ print(f"存储类型: {upload_info.storage_type}")
668
+ print(f"存储路径: {upload_info.stored_path}")
657
669
  ```
658
670
 
659
671
  #### 重命名文件
@@ -1576,10 +1588,12 @@ folder = await client.folders.create_folder(
1576
1588
 
1577
1589
  # 同步客户端同样支持
1578
1590
  sync_client = TamarFileHubClient(user_context=user_context)
1579
- file_info = sync_client.files.get_file(
1591
+ response = sync_client.files.get_file(
1580
1592
  file_id="file-123",
1581
1593
  request_id="debug-get-file-001"
1582
1594
  )
1595
+ # response.file 包含文件基本信息
1596
+ # response.upload_file 包含上传文件详细信息(可能为None)
1583
1597
  ```
1584
1598
 
1585
1599
  #### 请求ID优先级
@@ -1633,7 +1647,8 @@ await minimal_client.taples.create_table(name="auto_generated")
1633
1647
  - 所有批量操作方法
1634
1648
 
1635
1649
  **文件服务**:
1636
- - `get_file()`, `rename_file()`, `delete_file()`, `list_files()`
1650
+ - `get_file()` - 返回 `GetFileResponse` 对象,包含 `file` `upload_file` 信息
1651
+ - `rename_file()`, `delete_file()`, `list_files()`
1637
1652
  - `generate_share_link()`, `visit_file()`
1638
1653
 
1639
1654
  **文件夹服务**:
@@ -26,7 +26,7 @@ from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__
26
26
  from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2
27
27
 
28
28
 
29
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x12\x66ile_service.proto\x12\x04\x66ile\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xab\x01\n\x04\x46ile\x12\n\n\x02id\x18\x01 \x01(\t\x12\x11\n\tfolder_id\x18\x02 \x01(\t\x12\x11\n\tfile_name\x18\x03 \x01(\t\x12\x11\n\tfile_type\x18\x04 \x01(\t\x12.\n\ncreated_at\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12.\n\nupdated_at\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xb7\x02\n\nUploadFile\x12\n\n\x02id\x18\x01 \x01(\t\x12\x11\n\tfolder_id\x18\x02 \x01(\t\x12\x0f\n\x07\x66ile_id\x18\x03 \x01(\t\x12\x14\n\x0cstorage_type\x18\x04 \x01(\t\x12\x13\n\x0bstored_name\x18\x05 \x01(\t\x12\x13\n\x0bstored_path\x18\x06 \x01(\t\x12\x11\n\tfile_name\x18\x07 \x01(\t\x12\x11\n\tfile_size\x18\x08 \x01(\x03\x12\x10\n\x08\x66ile_ext\x18\t \x01(\t\x12\x11\n\tmime_type\x18\n \x01(\t\x12\x0e\n\x06status\x18\x0b \x01(\t\x12.\n\ncreated_at\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12.\n\nupdated_at\x18\r \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xdf\x01\n\x11UploadFileRequest\x12\x16\n\tfolder_id\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x11\n\tfile_name\x18\x02 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\x0c\x12\x11\n\tfile_type\x18\x04 \x01(\t\x12\x11\n\tmime_type\x18\x05 \x01(\t\x12\x19\n\x0cis_temporary\x18\x06 \x01(\x08H\x01\x88\x01\x01\x12\x1b\n\x0e\x65xpire_seconds\x18\x07 \x01(\x05H\x02\x88\x01\x01\x42\x0c\n\n_folder_idB\x0f\n\r_is_temporaryB\x11\n\x0f_expire_seconds\"\xf3\x01\n\x10UploadUrlRequest\x12\x16\n\tfolder_id\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x11\n\tfile_name\x18\x02 \x01(\t\x12\x11\n\tfile_type\x18\x03 \x01(\t\x12\x11\n\tmime_type\x18\x04 \x01(\t\x12\x11\n\tfile_size\x18\x05 \x01(\x03\x12\x11\n\tfile_hash\x18\x06 \x01(\t\x12\x19\n\x0cis_temporary\x18\x07 \x01(\x08H\x01\x88\x01\x01\x12\x1b\n\x0e\x65xpire_seconds\x18\x08 \x01(\x05H\x02\x88\x01\x01\x42\x0c\n\n_folder_idB\x0f\n\r_is_temporaryB\x11\n\x0f_expire_seconds\")\n\x16UploadCompletedRequest\x12\x0f\n\x07\x66ile_id\x18\x01 \x01(\t\"u\n\x12\x44ownloadUrlRequest\x12\x0f\n\x07\x66ile_id\x18\x01 \x01(\t\x12\x13\n\x06is_cdn\x18\x03 \x01(\x08H\x00\x88\x01\x01\x12\x1b\n\x0e\x65xpire_seconds\x18\x02 \x01(\x05H\x01\x88\x01\x01\x42\t\n\x07_is_cdnB\x11\n\x0f_expire_seconds\"\xd4\x01\n\x10ShareLinkRequest\x12\x0f\n\x07\x66ile_id\x18\x01 \x01(\t\x12\x11\n\tis_public\x18\x02 \x01(\x08\x12\x14\n\x0c\x61\x63\x63\x65ss_scope\x18\x03 \x01(\t\x12\x1b\n\x0e\x65xpire_seconds\x18\x04 \x01(\x05H\x00\x88\x01\x01\x12\x17\n\nmax_access\x18\x05 \x01(\x05H\x01\x88\x01\x01\x12\x1b\n\x0eshare_password\x18\x06 \x01(\tH\x02\x88\x01\x01\x42\x11\n\x0f_expire_secondsB\r\n\x0b_max_accessB\x11\n\x0f_share_password\"\x82\x01\n\x10\x46ileVisitRequest\x12\x15\n\rfile_share_id\x18\x01 \x01(\t\x12\x13\n\x0b\x61\x63\x63\x65ss_type\x18\x02 \x01(\t\x12\x17\n\x0f\x61\x63\x63\x65ss_duration\x18\x03 \x01(\x05\x12)\n\x08metadata\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\"!\n\x0eGetFileRequest\x12\x0f\n\x07\x66ile_id\x18\x01 \x01(\t\"6\n\x11RenameFileRequest\x12\x0f\n\x07\x66ile_id\x18\x01 \x01(\t\x12\x10\n\x08new_name\x18\x02 \x01(\t\"$\n\x11\x44\x65leteFileRequest\x12\x0f\n\x07\x66ile_id\x18\x01 \x01(\t\"\x8d\x02\n\x10ListFilesRequest\x12\x16\n\tfolder_id\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x16\n\tfile_name\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x11\n\tfile_type\x18\x03 \x03(\t\x12\x1c\n\x0f\x63reated_by_role\x18\x04 \x01(\tH\x02\x88\x01\x01\x12\x17\n\ncreated_by\x18\x05 \x01(\tH\x03\x88\x01\x01\x12\x16\n\tpage_size\x18\x06 \x01(\x05H\x04\x88\x01\x01\x12\x11\n\x04page\x18\x07 \x01(\x05H\x05\x88\x01\x01\x42\x0c\n\n_folder_idB\x0c\n\n_file_nameB\x12\n\x10_created_by_roleB\r\n\x0b_created_byB\x0c\n\n_page_sizeB\x07\n\x05_page\"U\n\x12UploadFileResponse\x12\x18\n\x04\x66ile\x18\x01 \x01(\x0b\x32\n.file.File\x12%\n\x0bupload_file\x18\x02 \x01(\x0b\x32\x10.file.UploadFile\"a\n\x11UploadUrlResponse\x12\x18\n\x04\x66ile\x18\x01 \x01(\x0b\x32\n.file.File\x12%\n\x0bupload_file\x18\x02 \x01(\x0b\x32\x10.file.UploadFile\x12\x0b\n\x03url\x18\x03 \x01(\t\"\"\n\x13\x44ownloadUrlResponse\x12\x0b\n\x03url\x18\x01 \x01(\t\"*\n\x11ShareLinkResponse\x12\x15\n\rfile_share_id\x18\x01 \x01(\t\"-\n\x10\x46ileListResponse\x12\x19\n\x05\x66iles\x18\x01 \x03(\x0b\x32\n.file.File\"\x07\n\x05\x45mpty2\xbd\x05\n\x0b\x46ileService\x12?\n\nUploadFile\x12\x17.file.UploadFileRequest\x1a\x18.file.UploadFileResponse\x12\x44\n\x11GenerateUploadUrl\x12\x16.file.UploadUrlRequest\x1a\x17.file.UploadUrlResponse\x12M\n\x1aGenerateResumableUploadUrl\x12\x16.file.UploadUrlRequest\x1a\x17.file.UploadUrlResponse\x12\x43\n\x16\x43onfirmUploadCompleted\x12\x1c.file.UploadCompletedRequest\x1a\x0b.file.Empty\x12J\n\x13GenerateDownloadUrl\x12\x18.file.DownloadUrlRequest\x1a\x19.file.DownloadUrlResponse\x12\x44\n\x11GenerateShareLink\x12\x16.file.ShareLinkRequest\x1a\x17.file.ShareLinkResponse\x12\x30\n\tVisitFile\x12\x16.file.FileVisitRequest\x1a\x0b.file.Empty\x12+\n\x07GetFile\x12\x14.file.GetFileRequest\x1a\n.file.File\x12\x31\n\nRenameFile\x12\x17.file.RenameFileRequest\x1a\n.file.File\x12\x32\n\nDeleteFile\x12\x17.file.DeleteFileRequest\x1a\x0b.file.Empty\x12;\n\tListFiles\x12\x16.file.ListFilesRequest\x1a\x16.file.FileListResponseb\x06proto3')
29
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x12\x66ile_service.proto\x12\x04\x66ile\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xab\x01\n\x04\x46ile\x12\n\n\x02id\x18\x01 \x01(\t\x12\x11\n\tfolder_id\x18\x02 \x01(\t\x12\x11\n\tfile_name\x18\x03 \x01(\t\x12\x11\n\tfile_type\x18\x04 \x01(\t\x12.\n\ncreated_at\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12.\n\nupdated_at\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xb7\x02\n\nUploadFile\x12\n\n\x02id\x18\x01 \x01(\t\x12\x11\n\tfolder_id\x18\x02 \x01(\t\x12\x0f\n\x07\x66ile_id\x18\x03 \x01(\t\x12\x14\n\x0cstorage_type\x18\x04 \x01(\t\x12\x13\n\x0bstored_name\x18\x05 \x01(\t\x12\x13\n\x0bstored_path\x18\x06 \x01(\t\x12\x11\n\tfile_name\x18\x07 \x01(\t\x12\x11\n\tfile_size\x18\x08 \x01(\x03\x12\x10\n\x08\x66ile_ext\x18\t \x01(\t\x12\x11\n\tmime_type\x18\n \x01(\t\x12\x0e\n\x06status\x18\x0b \x01(\t\x12.\n\ncreated_at\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12.\n\nupdated_at\x18\r \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xdf\x01\n\x11UploadFileRequest\x12\x16\n\tfolder_id\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x11\n\tfile_name\x18\x02 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\x0c\x12\x11\n\tfile_type\x18\x04 \x01(\t\x12\x11\n\tmime_type\x18\x05 \x01(\t\x12\x19\n\x0cis_temporary\x18\x06 \x01(\x08H\x01\x88\x01\x01\x12\x1b\n\x0e\x65xpire_seconds\x18\x07 \x01(\x05H\x02\x88\x01\x01\x42\x0c\n\n_folder_idB\x0f\n\r_is_temporaryB\x11\n\x0f_expire_seconds\"\xf3\x01\n\x10UploadUrlRequest\x12\x16\n\tfolder_id\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x11\n\tfile_name\x18\x02 \x01(\t\x12\x11\n\tfile_type\x18\x03 \x01(\t\x12\x11\n\tmime_type\x18\x04 \x01(\t\x12\x11\n\tfile_size\x18\x05 \x01(\x03\x12\x11\n\tfile_hash\x18\x06 \x01(\t\x12\x19\n\x0cis_temporary\x18\x07 \x01(\x08H\x01\x88\x01\x01\x12\x1b\n\x0e\x65xpire_seconds\x18\x08 \x01(\x05H\x02\x88\x01\x01\x42\x0c\n\n_folder_idB\x0f\n\r_is_temporaryB\x11\n\x0f_expire_seconds\")\n\x16UploadCompletedRequest\x12\x0f\n\x07\x66ile_id\x18\x01 \x01(\t\"u\n\x12\x44ownloadUrlRequest\x12\x0f\n\x07\x66ile_id\x18\x01 \x01(\t\x12\x13\n\x06is_cdn\x18\x03 \x01(\x08H\x00\x88\x01\x01\x12\x1b\n\x0e\x65xpire_seconds\x18\x02 \x01(\x05H\x01\x88\x01\x01\x42\t\n\x07_is_cdnB\x11\n\x0f_expire_seconds\"\xd4\x01\n\x10ShareLinkRequest\x12\x0f\n\x07\x66ile_id\x18\x01 \x01(\t\x12\x11\n\tis_public\x18\x02 \x01(\x08\x12\x14\n\x0c\x61\x63\x63\x65ss_scope\x18\x03 \x01(\t\x12\x1b\n\x0e\x65xpire_seconds\x18\x04 \x01(\x05H\x00\x88\x01\x01\x12\x17\n\nmax_access\x18\x05 \x01(\x05H\x01\x88\x01\x01\x12\x1b\n\x0eshare_password\x18\x06 \x01(\tH\x02\x88\x01\x01\x42\x11\n\x0f_expire_secondsB\r\n\x0b_max_accessB\x11\n\x0f_share_password\"\x82\x01\n\x10\x46ileVisitRequest\x12\x15\n\rfile_share_id\x18\x01 \x01(\t\x12\x13\n\x0b\x61\x63\x63\x65ss_type\x18\x02 \x01(\t\x12\x17\n\x0f\x61\x63\x63\x65ss_duration\x18\x03 \x01(\x05\x12)\n\x08metadata\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\"!\n\x0eGetFileRequest\x12\x0f\n\x07\x66ile_id\x18\x01 \x01(\t\"6\n\x11RenameFileRequest\x12\x0f\n\x07\x66ile_id\x18\x01 \x01(\t\x12\x10\n\x08new_name\x18\x02 \x01(\t\"$\n\x11\x44\x65leteFileRequest\x12\x0f\n\x07\x66ile_id\x18\x01 \x01(\t\"\x8d\x02\n\x10ListFilesRequest\x12\x16\n\tfolder_id\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x16\n\tfile_name\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x11\n\tfile_type\x18\x03 \x03(\t\x12\x1c\n\x0f\x63reated_by_role\x18\x04 \x01(\tH\x02\x88\x01\x01\x12\x17\n\ncreated_by\x18\x05 \x01(\tH\x03\x88\x01\x01\x12\x16\n\tpage_size\x18\x06 \x01(\x05H\x04\x88\x01\x01\x12\x11\n\x04page\x18\x07 \x01(\x05H\x05\x88\x01\x01\x42\x0c\n\n_folder_idB\x0c\n\n_file_nameB\x12\n\x10_created_by_roleB\r\n\x0b_created_byB\x0c\n\n_page_sizeB\x07\n\x05_page\"U\n\x12UploadFileResponse\x12\x18\n\x04\x66ile\x18\x01 \x01(\x0b\x32\n.file.File\x12%\n\x0bupload_file\x18\x02 \x01(\x0b\x32\x10.file.UploadFile\"a\n\x11UploadUrlResponse\x12\x18\n\x04\x66ile\x18\x01 \x01(\x0b\x32\n.file.File\x12%\n\x0bupload_file\x18\x02 \x01(\x0b\x32\x10.file.UploadFile\x12\x0b\n\x03url\x18\x03 \x01(\t\"\"\n\x13\x44ownloadUrlResponse\x12\x0b\n\x03url\x18\x01 \x01(\t\"*\n\x11ShareLinkResponse\x12\x15\n\rfile_share_id\x18\x01 \x01(\t\"-\n\x10\x46ileListResponse\x12\x19\n\x05\x66iles\x18\x01 \x03(\x0b\x32\n.file.File\"g\n\x0fGetFileResponse\x12\x18\n\x04\x66ile\x18\x01 \x01(\x0b\x32\n.file.File\x12*\n\x0bupload_file\x18\x02 \x01(\x0b\x32\x10.file.UploadFileH\x00\x88\x01\x01\x42\x0e\n\x0c_upload_file\"\x07\n\x05\x45mpty2\xc8\x05\n\x0b\x46ileService\x12?\n\nUploadFile\x12\x17.file.UploadFileRequest\x1a\x18.file.UploadFileResponse\x12\x44\n\x11GenerateUploadUrl\x12\x16.file.UploadUrlRequest\x1a\x17.file.UploadUrlResponse\x12M\n\x1aGenerateResumableUploadUrl\x12\x16.file.UploadUrlRequest\x1a\x17.file.UploadUrlResponse\x12\x43\n\x16\x43onfirmUploadCompleted\x12\x1c.file.UploadCompletedRequest\x1a\x0b.file.Empty\x12J\n\x13GenerateDownloadUrl\x12\x18.file.DownloadUrlRequest\x1a\x19.file.DownloadUrlResponse\x12\x44\n\x11GenerateShareLink\x12\x16.file.ShareLinkRequest\x1a\x17.file.ShareLinkResponse\x12\x30\n\tVisitFile\x12\x16.file.FileVisitRequest\x1a\x0b.file.Empty\x12\x36\n\x07GetFile\x12\x14.file.GetFileRequest\x1a\x15.file.GetFileResponse\x12\x31\n\nRenameFile\x12\x17.file.RenameFileRequest\x1a\n.file.File\x12\x32\n\nDeleteFile\x12\x17.file.DeleteFileRequest\x1a\x0b.file.Empty\x12;\n\tListFiles\x12\x16.file.ListFilesRequest\x1a\x16.file.FileListResponseb\x06proto3')
30
30
 
31
31
  _globals = globals()
32
32
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
@@ -67,8 +67,10 @@ if not _descriptor._USE_C_DESCRIPTORS:
67
67
  _globals['_SHARELINKRESPONSE']._serialized_end=2226
68
68
  _globals['_FILELISTRESPONSE']._serialized_start=2228
69
69
  _globals['_FILELISTRESPONSE']._serialized_end=2273
70
- _globals['_EMPTY']._serialized_start=2275
71
- _globals['_EMPTY']._serialized_end=2282
72
- _globals['_FILESERVICE']._serialized_start=2285
73
- _globals['_FILESERVICE']._serialized_end=2986
70
+ _globals['_GETFILERESPONSE']._serialized_start=2275
71
+ _globals['_GETFILERESPONSE']._serialized_end=2378
72
+ _globals['_EMPTY']._serialized_start=2380
73
+ _globals['_EMPTY']._serialized_end=2387
74
+ _globals['_FILESERVICE']._serialized_start=2390
75
+ _globals['_FILESERVICE']._serialized_end=3102
74
76
  # @@protoc_insertion_point(module_scope)
@@ -74,7 +74,7 @@ class FileServiceStub(object):
74
74
  self.GetFile = channel.unary_unary(
75
75
  '/file.FileService/GetFile',
76
76
  request_serializer=file__service__pb2.GetFileRequest.SerializeToString,
77
- response_deserializer=file__service__pb2.File.FromString,
77
+ response_deserializer=file__service__pb2.GetFileResponse.FromString,
78
78
  _registered_method=True)
79
79
  self.RenameFile = channel.unary_unary(
80
80
  '/file.FileService/RenameFile',
@@ -205,7 +205,7 @@ def add_FileServiceServicer_to_server(servicer, server):
205
205
  'GetFile': grpc.unary_unary_rpc_method_handler(
206
206
  servicer.GetFile,
207
207
  request_deserializer=file__service__pb2.GetFileRequest.FromString,
208
- response_serializer=file__service__pb2.File.SerializeToString,
208
+ response_serializer=file__service__pb2.GetFileResponse.SerializeToString,
209
209
  ),
210
210
  'RenameFile': grpc.unary_unary_rpc_method_handler(
211
211
  servicer.RenameFile,
@@ -440,7 +440,7 @@ class FileService(object):
440
440
  target,
441
441
  '/file.FileService/GetFile',
442
442
  file__service__pb2.GetFileRequest.SerializeToString,
443
- file__service__pb2.File.FromString,
443
+ file__service__pb2.GetFileResponse.FromString,
444
444
  options,
445
445
  channel_credentials,
446
446
  insecure,
@@ -15,7 +15,7 @@ service FileService {
15
15
  rpc GenerateDownloadUrl (DownloadUrlRequest) returns (DownloadUrlResponse);
16
16
  rpc GenerateShareLink (ShareLinkRequest) returns (ShareLinkResponse);
17
17
  rpc VisitFile (FileVisitRequest) returns (Empty);
18
- rpc GetFile (GetFileRequest) returns (File);
18
+ rpc GetFile (GetFileRequest) returns (GetFileResponse);
19
19
  rpc RenameFile (RenameFileRequest) returns (File);
20
20
  rpc DeleteFile (DeleteFileRequest) returns (Empty);
21
21
  rpc ListFiles (ListFilesRequest) returns (FileListResponse);
@@ -145,4 +145,9 @@ message FileListResponse {
145
145
  repeated File files = 1;
146
146
  }
147
147
 
148
+ message GetFileResponse {
149
+ File file = 1;
150
+ optional UploadFile upload_file = 2;
151
+ }
152
+
148
153
  message Empty {}
@@ -10,6 +10,7 @@ from .file import (
10
10
  FileVisitRequest,
11
11
  FileListRequest,
12
12
  FileListResponse,
13
+ GetFileResponse,
13
14
  )
14
15
  from .folder import (
15
16
  FolderInfo,
@@ -61,6 +62,7 @@ __all__ = [
61
62
  "FileVisitRequest",
62
63
  "FileListRequest",
63
64
  "FileListResponse",
65
+ "GetFileResponse",
64
66
 
65
67
  # 文件夹相关
66
68
  "FolderInfo",
@@ -87,3 +87,9 @@ class FileListRequest(BaseModel):
87
87
  class FileListResponse(BaseModel):
88
88
  """文件列表响应"""
89
89
  files: List[File] = Field(default_factory=list, description="文件列表")
90
+
91
+
92
+ class GetFileResponse(BaseModel):
93
+ """获取文件响应"""
94
+ file: File = Field(..., description="文件信息")
95
+ upload_file: Optional[UploadFile] = Field(None, description="上传文件信息")
@@ -11,6 +11,7 @@ from ...rpc.async_client import AsyncGrpcClient
11
11
  from ...schemas import (
12
12
  File,
13
13
  FileListResponse,
14
+ GetFileResponse,
14
15
  )
15
16
  from ...errors import FileNotFoundError
16
17
 
@@ -120,7 +121,7 @@ class AsyncFileService(BaseFileService):
120
121
  await stub.VisitFile(request, metadata=grpc_metadata)
121
122
 
122
123
  async def get_file(self, file_id: str, request_id: Optional[str] = None,
123
- **metadata) -> File:
124
+ **metadata) -> GetFileResponse:
124
125
  """
125
126
  获取文件信息
126
127
 
@@ -129,9 +130,10 @@ class AsyncFileService(BaseFileService):
129
130
  **metadata: 额外的元数据(如 x-org-id, x-user-id 等)
130
131
 
131
132
  Returns:
132
- 文件信息
133
+ 文件信息响应,包含文件信息和上传文件信息
133
134
  """
134
135
  from ...rpc.gen import file_service_pb2, file_service_pb2_grpc
136
+ from ...schemas.file import GetFileResponse
135
137
 
136
138
  stub = await self.client.get_stub(file_service_pb2_grpc.FileServiceStub)
137
139
 
@@ -142,7 +144,16 @@ class AsyncFileService(BaseFileService):
142
144
 
143
145
  try:
144
146
  response = await stub.GetFile(request, metadata=grpc_metadata)
145
- return self._convert_file_info(response)
147
+
148
+ # 转换文件信息
149
+ file_info = self._convert_file_info(response.file)
150
+
151
+ # 转换上传文件信息(如果存在)
152
+ upload_file_info = None
153
+ if response.HasField('upload_file'):
154
+ upload_file_info = self._convert_upload_file_info(response.upload_file)
155
+
156
+ return GetFileResponse(file=file_info, upload_file=upload_file_info)
146
157
  except grpc.RpcError as e:
147
158
  if e.code() == grpc.StatusCode.NOT_FOUND:
148
159
  raise FileNotFoundError(file_id)
@@ -9,6 +9,7 @@ from ...rpc.sync_client import SyncGrpcClient
9
9
  from ...schemas import (
10
10
  File,
11
11
  FileListResponse,
12
+ GetFileResponse,
12
13
  )
13
14
  from ...errors import FileNotFoundError
14
15
 
@@ -118,7 +119,7 @@ class SyncFileService(BaseFileService):
118
119
  stub.VisitFile(request, metadata=grpc_metadata)
119
120
 
120
121
  def get_file(self, file_id: str, request_id: Optional[str] = None,
121
- **metadata) -> File:
122
+ **metadata) -> GetFileResponse:
122
123
  """
123
124
  获取文件信息
124
125
 
@@ -127,9 +128,10 @@ class SyncFileService(BaseFileService):
127
128
  **metadata: 额外的元数据(如 x-org-id, x-user-id 等)
128
129
 
129
130
  Returns:
130
- 文件信息
131
+ 文件信息响应,包含文件信息和上传文件信息
131
132
  """
132
133
  from ...rpc.gen import file_service_pb2, file_service_pb2_grpc
134
+ from ...schemas.file import GetFileResponse
133
135
 
134
136
  stub = self.client.get_stub(file_service_pb2_grpc.FileServiceStub)
135
137
 
@@ -140,7 +142,16 @@ class SyncFileService(BaseFileService):
140
142
 
141
143
  try:
142
144
  response = stub.GetFile(request, metadata=grpc_metadata)
143
- return self._convert_file_info(response)
145
+
146
+ # 转换文件信息
147
+ file_info = self._convert_file_info(response.file)
148
+
149
+ # 转换上传文件信息(如果存在)
150
+ upload_file_info = None
151
+ if response.HasField('upload_file'):
152
+ upload_file_info = self._convert_upload_file_info(response.upload_file)
153
+
154
+ return GetFileResponse(file=file_info, upload_file=upload_file_info)
144
155
  except grpc.RpcError as e:
145
156
  if e.code() == grpc.StatusCode.NOT_FOUND:
146
157
  raise FileNotFoundError(file_id)
@@ -2058,7 +2058,7 @@ class AsyncTapleService(BaseTapleService):
2058
2058
  """
2059
2059
  from ...rpc.gen import taple_service_pb2, taple_service_pb2_grpc
2060
2060
  from ...schemas.taple import TableViewResponse
2061
- from google.protobuf.struct_pb2 import ListValue
2061
+
2062
2062
 
2063
2063
  stub = await self.client.get_stub(taple_service_pb2_grpc.TapleServiceStub)
2064
2064
 
@@ -2166,7 +2166,19 @@ class AsyncTapleService(BaseTapleService):
2166
2166
  from google.protobuf.json_format import MessageToDict
2167
2167
 
2168
2168
  # 处理 visible_columns 的转换
2169
- visible_columns = MessageToDict(proto_view.visible_columns) if proto_view.HasField('visible_columns') else None
2169
+ if proto_view.HasField('visible_columns'):
2170
+ visible_columns_dict = MessageToDict(proto_view.visible_columns)
2171
+ # 如果服务器返回的是旧格式(包含 items 字段的结构),需要转换
2172
+ if isinstance(visible_columns_dict, dict) and 'items' in visible_columns_dict:
2173
+ # 旧格式:将列表转换为字典,默认所有列都显示
2174
+ if isinstance(visible_columns_dict['items'], list):
2175
+ visible_columns = {col: True for col in visible_columns_dict['items']}
2176
+ else:
2177
+ visible_columns = visible_columns_dict
2178
+ else:
2179
+ visible_columns = visible_columns_dict
2180
+ else:
2181
+ visible_columns = None
2170
2182
 
2171
2183
  return TableView(
2172
2184
  id=proto_view.id,
@@ -159,7 +159,19 @@ class BaseTapleService(IdempotentTapleMixin):
159
159
  config = MessageToDict(proto_view.config) if proto_view.HasField('config') else {}
160
160
  filter_criteria = MessageToDict(proto_view.filter_criteria) if proto_view.HasField('filter_criteria') else None
161
161
  sort_criteria = MessageToDict(proto_view.sort_criteria) if proto_view.HasField('sort_criteria') else None
162
- visible_columns = MessageToDict(proto_view.visible_columns) if proto_view.HasField('visible_columns') else None
162
+ if proto_view.HasField('visible_columns'):
163
+ visible_columns_dict = MessageToDict(proto_view.visible_columns)
164
+ # 如果服务器返回的是旧格式(包含 items 字段的结构),需要转换
165
+ if isinstance(visible_columns_dict, dict) and 'items' in visible_columns_dict:
166
+ # 旧格式:将列表转换为字典,默认所有列都显示
167
+ if isinstance(visible_columns_dict['items'], list):
168
+ visible_columns = {col: True for col in visible_columns_dict['items']}
169
+ else:
170
+ visible_columns = visible_columns_dict
171
+ else:
172
+ visible_columns = visible_columns_dict
173
+ else:
174
+ visible_columns = None
163
175
  group_criteria = MessageToDict(proto_view.group_criteria) if proto_view.HasField('group_criteria') else None
164
176
 
165
177
  return TableView(
@@ -2033,7 +2033,7 @@ class SyncTapleService(BaseTapleService):
2033
2033
  """
2034
2034
  from ...rpc.gen import taple_service_pb2, taple_service_pb2_grpc
2035
2035
  from ...schemas.taple import TableViewResponse
2036
- from google.protobuf.struct_pb2 import ListValue
2036
+
2037
2037
 
2038
2038
  stub = self.client.get_stub(taple_service_pb2_grpc.TapleServiceStub)
2039
2039
 
@@ -2141,7 +2141,19 @@ class SyncTapleService(BaseTapleService):
2141
2141
  from google.protobuf.json_format import MessageToDict
2142
2142
 
2143
2143
  # 处理 visible_columns 的转换
2144
- visible_columns = MessageToDict(proto_view.visible_columns) if proto_view.HasField('visible_columns') else None
2144
+ if proto_view.HasField('visible_columns'):
2145
+ visible_columns_dict = MessageToDict(proto_view.visible_columns)
2146
+ # 如果服务器返回的是旧格式(包含 items 字段的结构),需要转换
2147
+ if isinstance(visible_columns_dict, dict) and 'items' in visible_columns_dict:
2148
+ # 旧格式:将列表转换为字典,默认所有列都显示
2149
+ if isinstance(visible_columns_dict['items'], list):
2150
+ visible_columns = {col: True for col in visible_columns_dict['items']}
2151
+ else:
2152
+ visible_columns = visible_columns_dict
2153
+ else:
2154
+ visible_columns = visible_columns_dict
2155
+ else:
2156
+ visible_columns = None
2145
2157
 
2146
2158
  return TableView(
2147
2159
  id=proto_view.id,
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="tamar-file-hub-client",
5
- version="0.0.11",
5
+ version="0.1.0",
6
6
  description="A Python SDK for gRPC-based file management system",
7
7
  long_description=open("README.md", encoding="utf-8").read(),
8
8
  long_description_content_type="text/markdown",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tamar-file-hub-client
3
- Version: 0.0.11
3
+ Version: 0.1.0
4
4
  Summary: A Python SDK for gRPC-based file management system
5
5
  Home-page: https://github.com/Tamar-Edge-AI/file-hub-client
6
6
  Author: Oscar Ou
@@ -695,11 +695,23 @@ async with AsyncTamarFileHubClient() as client:
695
695
  # 设置用户上下文
696
696
  client.set_user_context(org_id="123", user_id="456")
697
697
 
698
- # 获取文件详细信息
699
- file_info = await client.files.get_file(file_id="file-001")
698
+ # 获取文件详细信息(返回 GetFileResponse 对象)
699
+ response = await client.files.get_file(file_id="file-001")
700
+
701
+ # 访问文件基本信息
702
+ file_info = response.file
703
+ print(f"文件ID: {file_info.id}")
700
704
  print(f"文件名: {file_info.file_name}")
701
- print(f"文件大小: {file_info.file_size} bytes")
705
+ print(f"文件类型: {file_info.file_type}")
702
706
  print(f"创建时间: {file_info.created_at}")
707
+
708
+ # 访问上传文件详细信息(如果存在)
709
+ if response.upload_file:
710
+ upload_info = response.upload_file
711
+ print(f"文件大小: {upload_info.file_size} bytes")
712
+ print(f"MIME类型: {upload_info.mime_type}")
713
+ print(f"存储类型: {upload_info.storage_type}")
714
+ print(f"存储路径: {upload_info.stored_path}")
703
715
  ```
704
716
 
705
717
  #### 重命名文件
@@ -1622,10 +1634,12 @@ folder = await client.folders.create_folder(
1622
1634
 
1623
1635
  # 同步客户端同样支持
1624
1636
  sync_client = TamarFileHubClient(user_context=user_context)
1625
- file_info = sync_client.files.get_file(
1637
+ response = sync_client.files.get_file(
1626
1638
  file_id="file-123",
1627
1639
  request_id="debug-get-file-001"
1628
1640
  )
1641
+ # response.file 包含文件基本信息
1642
+ # response.upload_file 包含上传文件详细信息(可能为None)
1629
1643
  ```
1630
1644
 
1631
1645
  #### 请求ID优先级
@@ -1679,7 +1693,8 @@ await minimal_client.taples.create_table(name="auto_generated")
1679
1693
  - 所有批量操作方法
1680
1694
 
1681
1695
  **文件服务**:
1682
- - `get_file()`, `rename_file()`, `delete_file()`, `list_files()`
1696
+ - `get_file()` - 返回 `GetFileResponse` 对象,包含 `file` `upload_file` 信息
1697
+ - `rename_file()`, `delete_file()`, `list_files()`
1683
1698
  - `generate_share_link()`, `visit_file()`
1684
1699
 
1685
1700
  **文件夹服务**: