tamar-file-hub-client 0.2.1__tar.gz → 0.2.2__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 tamar-file-hub-client might be problematic. Click here for more details.

Files changed (65) hide show
  1. {tamar_file_hub_client-0.2.1/tamar_file_hub_client.egg-info → tamar_file_hub_client-0.2.2}/PKG-INFO +1 -1
  2. tamar_file_hub_client-0.2.2/file_hub_client/rpc/gen/file_service_pb2.py +124 -0
  3. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/rpc/protos/file_service.proto +1 -0
  4. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/services/file/async_blob_service.py +27 -3
  5. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/services/file/sync_blob_service.py +28 -4
  6. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/utils/logging.py +11 -15
  7. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/utils/upload_helper.py +67 -3
  8. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/setup.py +1 -1
  9. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2/tamar_file_hub_client.egg-info}/PKG-INFO +1 -1
  10. tamar_file_hub_client-0.2.1/file_hub_client/rpc/gen/file_service_pb2.py +0 -124
  11. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/MANIFEST.in +0 -0
  12. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/README.md +0 -0
  13. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/__init__.py +0 -0
  14. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/client.py +0 -0
  15. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/enums/__init__.py +0 -0
  16. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/enums/export_format.py +0 -0
  17. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/enums/role.py +0 -0
  18. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/enums/upload_mode.py +0 -0
  19. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/errors/__init__.py +0 -0
  20. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/errors/exceptions.py +0 -0
  21. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/py.typed +0 -0
  22. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/rpc/__init__.py +0 -0
  23. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/rpc/async_client.py +0 -0
  24. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/rpc/gen/__init__.py +0 -0
  25. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/rpc/gen/file_service_pb2_grpc.py +0 -0
  26. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/rpc/gen/folder_service_pb2.py +0 -0
  27. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/rpc/gen/folder_service_pb2_grpc.py +0 -0
  28. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/rpc/gen/taple_service_pb2.py +0 -0
  29. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/rpc/gen/taple_service_pb2_grpc.py +0 -0
  30. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/rpc/interceptors.py +0 -0
  31. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/rpc/protos/folder_service.proto +0 -0
  32. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/rpc/protos/taple_service.proto +0 -0
  33. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/rpc/sync_client.py +0 -0
  34. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/schemas/__init__.py +0 -0
  35. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/schemas/context.py +0 -0
  36. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/schemas/file.py +0 -0
  37. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/schemas/folder.py +0 -0
  38. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/schemas/taple.py +0 -0
  39. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/services/__init__.py +0 -0
  40. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/services/file/__init__.py +0 -0
  41. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/services/file/async_file_service.py +0 -0
  42. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/services/file/base_file_service.py +0 -0
  43. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/services/file/sync_file_service.py +0 -0
  44. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/services/folder/__init__.py +0 -0
  45. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/services/folder/async_folder_service.py +0 -0
  46. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/services/folder/sync_folder_service.py +0 -0
  47. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/services/taple/__init__.py +0 -0
  48. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/services/taple/async_taple_service.py +0 -0
  49. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/services/taple/base_taple_service.py +0 -0
  50. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/services/taple/idempotent_taple_mixin.py +0 -0
  51. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/services/taple/sync_taple_service.py +0 -0
  52. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/utils/__init__.py +0 -0
  53. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/utils/converter.py +0 -0
  54. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/utils/download_helper.py +0 -0
  55. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/utils/file_utils.py +0 -0
  56. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/utils/idempotency.py +0 -0
  57. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/utils/ip_detector.py +0 -0
  58. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/utils/mime_extension_mapper.py +0 -0
  59. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/utils/retry.py +0 -0
  60. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/file_hub_client/utils/smart_retry.py +0 -0
  61. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/setup.cfg +0 -0
  62. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/tamar_file_hub_client.egg-info/SOURCES.txt +0 -0
  63. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/tamar_file_hub_client.egg-info/dependency_links.txt +0 -0
  64. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/tamar_file_hub_client.egg-info/requires.txt +0 -0
  65. {tamar_file_hub_client-0.2.1 → tamar_file_hub_client-0.2.2}/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.2.1
3
+ Version: 0.2.2
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
@@ -0,0 +1,124 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # NO CHECKED-IN PROTOBUF GENCODE
4
+ # source: file_service.proto
5
+ # Protobuf Python Version: 5.27.2
6
+ """Generated protocol buffer code."""
7
+ from google.protobuf import descriptor as _descriptor
8
+ from google.protobuf import descriptor_pool as _descriptor_pool
9
+ from google.protobuf import runtime_version as _runtime_version
10
+ from google.protobuf import symbol_database as _symbol_database
11
+ from google.protobuf.internal import builder as _builder
12
+ _runtime_version.ValidateProtobufRuntimeVersion(
13
+ _runtime_version.Domain.PUBLIC,
14
+ 5,
15
+ 27,
16
+ 2,
17
+ '',
18
+ 'file_service.proto'
19
+ )
20
+ # @@protoc_insertion_point(imports)
21
+
22
+ _sym_db = _symbol_database.Default()
23
+
24
+
25
+ from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2
26
+ from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2
27
+
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\"\x9f\x02\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\x12#\n\x16keep_original_filename\x18\x08 \x01(\x08H\x03\x88\x01\x01\x42\x0c\n\n_folder_idB\x0f\n\r_is_temporaryB\x11\n\x0f_expire_secondsB\x19\n\x17_keep_original_filename\"\xe7\x02\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\x12#\n\x16keep_original_filename\x18\t \x01(\x08H\x03\x88\x01\x01\x12\x1d\n\x10\x66orbid_overwrite\x18\n \x01(\x08H\x04\x88\x01\x01\x42\x0c\n\n_folder_idB\x0f\n\r_is_temporaryB\x11\n\x0f_expire_secondsB\x19\n\x17_keep_original_filenameB\x13\n\x11_forbid_overwrite\")\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\"{\n\x17\x42\x61tchDownloadUrlRequest\x12\x10\n\x08\x66ile_ids\x18\x01 \x03(\t\x12\x13\n\x06is_cdn\x18\x02 \x01(\x08H\x00\x88\x01\x01\x12\x1b\n\x0e\x65xpire_seconds\x18\x03 \x01(\x05H\x01\x88\x01\x01\x42\t\n\x07_is_cdnB\x11\n\x0f_expire_seconds\"#\n\x10GetGcsUrlRequest\x12\x0f\n\x07\x66ile_id\x18\x01 \x01(\t\")\n\x15\x42\x61tchGetGcsUrlRequest\x12\x10\n\x08\x66ile_ids\x18\x01 \x03(\t\"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\"H\n\x18\x42\x61tchDownloadUrlResponse\x12,\n\rdownload_urls\x18\x01 \x03(\x0b\x32\x15.file.DownloadUrlInfo\"`\n\x0f\x44ownloadUrlInfo\x12\x0f\n\x07\x66ile_id\x18\x01 \x01(\t\x12\x0b\n\x03url\x18\x02 \x01(\t\x12\x11\n\tmime_type\x18\x03 \x01(\t\x12\x12\n\x05\x65rror\x18\x04 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_error\"7\n\x11GetGcsUrlResponse\x12\x0f\n\x07gcs_url\x18\x01 \x01(\t\x12\x11\n\tmime_type\x18\x02 \x01(\t\"<\n\x16\x42\x61tchGetGcsUrlResponse\x12\"\n\x08gcs_urls\x18\x01 \x03(\x0b\x32\x10.file.GcsUrlInfo\"_\n\nGcsUrlInfo\x12\x0f\n\x07\x66ile_id\x18\x01 \x01(\t\x12\x0f\n\x07gcs_url\x18\x02 \x01(\t\x12\x11\n\tmime_type\x18\x03 \x01(\t\x12\x12\n\x05\x65rror\x18\x04 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_error\"+\n\x18\x43ompressionStatusRequest\x12\x0f\n\x07\x66ile_id\x18\x01 \x01(\t\"\x84\x01\n\x19\x43ompressionStatusResponse\x12\x0e\n\x06status\x18\x01 \x01(\t\x12\x1a\n\rerror_message\x18\x02 \x01(\tH\x00\x88\x01\x01\x12)\n\x08variants\x18\x03 \x03(\x0b\x32\x17.file.CompressedVariantB\x10\n\x0e_error_message\"Q\n\x12GetVariantsRequest\x12\x0f\n\x07\x66ile_id\x18\x01 \x01(\t\x12\x19\n\x0cvariant_type\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0f\n\r_variant_type\"@\n\x13GetVariantsResponse\x12)\n\x08variants\x18\x01 \x03(\x0b\x32\x17.file.CompressedVariant\"\xc7\x02\n\x11\x43ompressedVariant\x12\x14\n\x0cvariant_name\x18\x01 \x01(\t\x12\x14\n\x0cvariant_type\x18\x02 \x01(\t\x12\x12\n\nmedia_type\x18\x03 \x01(\t\x12\r\n\x05width\x18\x04 \x01(\x05\x12\x0e\n\x06height\x18\x05 \x01(\x05\x12\x11\n\tfile_size\x18\x06 \x01(\x03\x12\x0e\n\x06\x66ormat\x18\x07 \x01(\t\x12\x14\n\x07quality\x18\x08 \x01(\x05H\x00\x88\x01\x01\x12\x15\n\x08\x64uration\x18\t \x01(\x01H\x01\x88\x01\x01\x12\x14\n\x07\x62itrate\x18\n \x01(\x03H\x02\x88\x01\x01\x12\x10\n\x03\x66ps\x18\x0b \x01(\x05H\x03\x88\x01\x01\x12\x19\n\x11\x63ompression_ratio\x18\x0c \x01(\x01\x12\x13\n\x0bstored_path\x18\r \x01(\tB\n\n\x08_qualityB\x0b\n\t_durationB\n\n\x08_bitrateB\x06\n\x04_fps\"Y\n\x14RecompressionRequest\x12\x0f\n\x07\x66ile_id\x18\x01 \x01(\t\x12\x1c\n\x0f\x66orce_reprocess\x18\x02 \x01(\x08H\x00\x88\x01\x01\x42\x12\n\x10_force_reprocess\"8\n\x15RecompressionResponse\x12\x0f\n\x07task_id\x18\x01 \x01(\t\x12\x0e\n\x06status\x18\x02 \x01(\t\"\x92\x01\n\x19VariantDownloadUrlRequest\x12\x0f\n\x07\x66ile_id\x18\x01 \x01(\t\x12\x14\n\x0cvariant_name\x18\x02 \x01(\t\x12\x1b\n\x0e\x65xpire_seconds\x18\x03 \x01(\x05H\x00\x88\x01\x01\x12\x13\n\x06is_cdn\x18\x04 \x01(\x08H\x01\x88\x01\x01\x42\x11\n\x0f_expire_secondsB\t\n\x07_is_cdn\"\x8c\x01\n\x1aVariantDownloadUrlResponse\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\x12\n\x05\x65rror\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x32\n\x0cvariant_info\x18\x03 \x01(\x0b\x32\x17.file.CompressedVariantH\x01\x88\x01\x01\x42\x08\n\x06_errorB\x0f\n\r_variant_info\"\\\n\x16\x42\x61tchFileStatusRequest\x12\x10\n\x08\x66ile_ids\x18\x01 \x03(\t\x12\x1c\n\x0finclude_details\x18\x02 \x01(\x08H\x00\x88\x01\x01\x42\x12\n\x10_include_details\"m\n\x17\x42\x61tchFileStatusResponse\x12&\n\x08statuses\x18\x01 \x03(\x0b\x32\x14.file.FileStatusInfo\x12\x11\n\ttimestamp\x18\x02 \x01(\x03\x12\x17\n\x0f\x63\x61\x63he_hit_count\x18\x03 \x01(\x05\"\x9d\x02\n\x0e\x46ileStatusInfo\x12\x0f\n\x07\x66ile_id\x18\x01 \x01(\t\x12-\n\rupload_status\x18\x02 \x01(\x0e\x32\x16.file.FileUploadStatus\x12\x37\n\x12\x63ompression_status\x18\x03 \x01(\x0e\x32\x1b.file.FileCompressionStatus\x12)\n\x0bsync_status\x18\x04 \x01(\x0e\x32\x14.file.FileSyncStatus\x12-\n\x07\x64\x65tails\x18\x05 \x01(\x0b\x32\x17.file.FileStatusDetailsH\x00\x88\x01\x01\x12\x1a\n\rerror_message\x18\x06 \x01(\tH\x01\x88\x01\x01\x42\n\n\x08_detailsB\x10\n\x0e_error_message\"\xe9\x03\n\x11\x46ileStatusDetails\x12\x16\n\tfile_size\x18\x01 \x01(\x03H\x00\x88\x01\x01\x12\x19\n\x0cstorage_type\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x1b\n\x0estorage_region\x18\x03 \x01(\tH\x02\x88\x01\x01\x12 \n\x13\x63ompression_task_id\x18\x04 \x01(\tH\x03\x88\x01\x01\x12\'\n\x1a\x63ompression_variants_count\x18\x05 \x01(\x05H\x04\x88\x01\x01\x12!\n\x14\x63ompression_progress\x18\x06 \x01(\x01H\x05\x88\x01\x01\x12\x1f\n\x12sync_regions_total\x18\x07 \x01(\x05H\x06\x88\x01\x01\x12#\n\x16sync_regions_completed\x18\x08 \x01(\x05H\x07\x88\x01\x01\x12\x1c\n\x14sync_pending_regions\x18\t \x03(\tB\x0c\n\n_file_sizeB\x0f\n\r_storage_typeB\x11\n\x0f_storage_regionB\x16\n\x14_compression_task_idB\x1d\n\x1b_compression_variants_countB\x17\n\x15_compression_progressB\x15\n\x13_sync_regions_totalB\x19\n\x17_sync_regions_completed\"\x07\n\x05\x45mpty*\x95\x01\n\x10\x46ileUploadStatus\x12\x12\n\x0eUPLOAD_UNKNOWN\x10\x00\x12\x12\n\x0eUPLOAD_PENDING\x10\x01\x12\x15\n\x11UPLOAD_PROCESSING\x10\x02\x12\x14\n\x10UPLOAD_COMPLETED\x10\x03\x12\x11\n\rUPLOAD_FAILED\x10\x04\x12\x19\n\x15UPLOAD_FILE_NOT_FOUND\x10\x05*\xf1\x01\n\x15\x46ileCompressionStatus\x12\x17\n\x13\x43OMPRESSION_UNKNOWN\x10\x00\x12\x1e\n\x1a\x43OMPRESSION_NOT_APPLICABLE\x10\x01\x12\x17\n\x13\x43OMPRESSION_PENDING\x10\x02\x12\x1a\n\x16\x43OMPRESSION_PROCESSING\x10\x03\x12\x19\n\x15\x43OMPRESSION_COMPLETED\x10\x04\x12\x16\n\x12\x43OMPRESSION_FAILED\x10\x05\x12\x17\n\x13\x43OMPRESSION_SKIPPED\x10\x06\x12\x1e\n\x1a\x43OMPRESSION_FILE_NOT_FOUND\x10\x07*\xb0\x01\n\x0e\x46ileSyncStatus\x12\x10\n\x0cSYNC_UNKNOWN\x10\x00\x12\x15\n\x11SYNC_NOT_REQUIRED\x10\x01\x12\x10\n\x0cSYNC_PENDING\x10\x02\x12\x13\n\x0fSYNC_PROCESSING\x10\x03\x12\x10\n\x0cSYNC_PARTIAL\x10\x04\x12\x12\n\x0eSYNC_COMPLETED\x10\x05\x12\x0f\n\x0bSYNC_FAILED\x10\x06\x12\x17\n\x13SYNC_FILE_NOT_FOUND\x10\x07\x32\xda\n\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\x12Y\n\x18\x42\x61tchGenerateDownloadUrl\x12\x1d.file.BatchDownloadUrlRequest\x1a\x1e.file.BatchDownloadUrlResponse\x12<\n\tGetGcsUrl\x12\x16.file.GetGcsUrlRequest\x1a\x17.file.GetGcsUrlResponse\x12K\n\x0e\x42\x61tchGetGcsUrl\x12\x1b.file.BatchGetGcsUrlRequest\x1a\x1c.file.BatchGetGcsUrlResponse\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.FileListResponse\x12W\n\x14GetCompressionStatus\x12\x1e.file.CompressionStatusRequest\x1a\x1f.file.CompressionStatusResponse\x12L\n\x15GetCompressedVariants\x12\x18.file.GetVariantsRequest\x1a\x19.file.GetVariantsResponse\x12O\n\x14TriggerRecompression\x12\x1a.file.RecompressionRequest\x1a\x1b.file.RecompressionResponse\x12_\n\x1aGenerateVariantDownloadUrl\x12\x1f.file.VariantDownloadUrlRequest\x1a .file.VariantDownloadUrlResponse\x12Q\n\x12\x42\x61tchGetFileStatus\x12\x1c.file.BatchFileStatusRequest\x1a\x1d.file.BatchFileStatusResponseb\x06proto3')
30
+
31
+ _globals = globals()
32
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
33
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'file_service_pb2', _globals)
34
+ if not _descriptor._USE_C_DESCRIPTORS:
35
+ DESCRIPTOR._loaded_options = None
36
+ _globals['_FILEUPLOADSTATUS']._serialized_start=5248
37
+ _globals['_FILEUPLOADSTATUS']._serialized_end=5397
38
+ _globals['_FILECOMPRESSIONSTATUS']._serialized_start=5400
39
+ _globals['_FILECOMPRESSIONSTATUS']._serialized_end=5641
40
+ _globals['_FILESYNCSTATUS']._serialized_start=5644
41
+ _globals['_FILESYNCSTATUS']._serialized_end=5820
42
+ _globals['_FILE']._serialized_start=92
43
+ _globals['_FILE']._serialized_end=263
44
+ _globals['_UPLOADFILE']._serialized_start=266
45
+ _globals['_UPLOADFILE']._serialized_end=577
46
+ _globals['_UPLOADFILEREQUEST']._serialized_start=580
47
+ _globals['_UPLOADFILEREQUEST']._serialized_end=867
48
+ _globals['_UPLOADURLREQUEST']._serialized_start=870
49
+ _globals['_UPLOADURLREQUEST']._serialized_end=1229
50
+ _globals['_UPLOADCOMPLETEDREQUEST']._serialized_start=1231
51
+ _globals['_UPLOADCOMPLETEDREQUEST']._serialized_end=1272
52
+ _globals['_DOWNLOADURLREQUEST']._serialized_start=1274
53
+ _globals['_DOWNLOADURLREQUEST']._serialized_end=1391
54
+ _globals['_SHARELINKREQUEST']._serialized_start=1394
55
+ _globals['_SHARELINKREQUEST']._serialized_end=1606
56
+ _globals['_FILEVISITREQUEST']._serialized_start=1609
57
+ _globals['_FILEVISITREQUEST']._serialized_end=1739
58
+ _globals['_GETFILEREQUEST']._serialized_start=1741
59
+ _globals['_GETFILEREQUEST']._serialized_end=1774
60
+ _globals['_RENAMEFILEREQUEST']._serialized_start=1776
61
+ _globals['_RENAMEFILEREQUEST']._serialized_end=1830
62
+ _globals['_DELETEFILEREQUEST']._serialized_start=1832
63
+ _globals['_DELETEFILEREQUEST']._serialized_end=1868
64
+ _globals['_LISTFILESREQUEST']._serialized_start=1871
65
+ _globals['_LISTFILESREQUEST']._serialized_end=2140
66
+ _globals['_BATCHDOWNLOADURLREQUEST']._serialized_start=2142
67
+ _globals['_BATCHDOWNLOADURLREQUEST']._serialized_end=2265
68
+ _globals['_GETGCSURLREQUEST']._serialized_start=2267
69
+ _globals['_GETGCSURLREQUEST']._serialized_end=2302
70
+ _globals['_BATCHGETGCSURLREQUEST']._serialized_start=2304
71
+ _globals['_BATCHGETGCSURLREQUEST']._serialized_end=2345
72
+ _globals['_UPLOADFILERESPONSE']._serialized_start=2347
73
+ _globals['_UPLOADFILERESPONSE']._serialized_end=2432
74
+ _globals['_UPLOADURLRESPONSE']._serialized_start=2434
75
+ _globals['_UPLOADURLRESPONSE']._serialized_end=2531
76
+ _globals['_DOWNLOADURLRESPONSE']._serialized_start=2533
77
+ _globals['_DOWNLOADURLRESPONSE']._serialized_end=2567
78
+ _globals['_SHARELINKRESPONSE']._serialized_start=2569
79
+ _globals['_SHARELINKRESPONSE']._serialized_end=2611
80
+ _globals['_FILELISTRESPONSE']._serialized_start=2613
81
+ _globals['_FILELISTRESPONSE']._serialized_end=2658
82
+ _globals['_GETFILERESPONSE']._serialized_start=2660
83
+ _globals['_GETFILERESPONSE']._serialized_end=2763
84
+ _globals['_BATCHDOWNLOADURLRESPONSE']._serialized_start=2765
85
+ _globals['_BATCHDOWNLOADURLRESPONSE']._serialized_end=2837
86
+ _globals['_DOWNLOADURLINFO']._serialized_start=2839
87
+ _globals['_DOWNLOADURLINFO']._serialized_end=2935
88
+ _globals['_GETGCSURLRESPONSE']._serialized_start=2937
89
+ _globals['_GETGCSURLRESPONSE']._serialized_end=2992
90
+ _globals['_BATCHGETGCSURLRESPONSE']._serialized_start=2994
91
+ _globals['_BATCHGETGCSURLRESPONSE']._serialized_end=3054
92
+ _globals['_GCSURLINFO']._serialized_start=3056
93
+ _globals['_GCSURLINFO']._serialized_end=3151
94
+ _globals['_COMPRESSIONSTATUSREQUEST']._serialized_start=3153
95
+ _globals['_COMPRESSIONSTATUSREQUEST']._serialized_end=3196
96
+ _globals['_COMPRESSIONSTATUSRESPONSE']._serialized_start=3199
97
+ _globals['_COMPRESSIONSTATUSRESPONSE']._serialized_end=3331
98
+ _globals['_GETVARIANTSREQUEST']._serialized_start=3333
99
+ _globals['_GETVARIANTSREQUEST']._serialized_end=3414
100
+ _globals['_GETVARIANTSRESPONSE']._serialized_start=3416
101
+ _globals['_GETVARIANTSRESPONSE']._serialized_end=3480
102
+ _globals['_COMPRESSEDVARIANT']._serialized_start=3483
103
+ _globals['_COMPRESSEDVARIANT']._serialized_end=3810
104
+ _globals['_RECOMPRESSIONREQUEST']._serialized_start=3812
105
+ _globals['_RECOMPRESSIONREQUEST']._serialized_end=3901
106
+ _globals['_RECOMPRESSIONRESPONSE']._serialized_start=3903
107
+ _globals['_RECOMPRESSIONRESPONSE']._serialized_end=3959
108
+ _globals['_VARIANTDOWNLOADURLREQUEST']._serialized_start=3962
109
+ _globals['_VARIANTDOWNLOADURLREQUEST']._serialized_end=4108
110
+ _globals['_VARIANTDOWNLOADURLRESPONSE']._serialized_start=4111
111
+ _globals['_VARIANTDOWNLOADURLRESPONSE']._serialized_end=4251
112
+ _globals['_BATCHFILESTATUSREQUEST']._serialized_start=4253
113
+ _globals['_BATCHFILESTATUSREQUEST']._serialized_end=4345
114
+ _globals['_BATCHFILESTATUSRESPONSE']._serialized_start=4347
115
+ _globals['_BATCHFILESTATUSRESPONSE']._serialized_end=4456
116
+ _globals['_FILESTATUSINFO']._serialized_start=4459
117
+ _globals['_FILESTATUSINFO']._serialized_end=4744
118
+ _globals['_FILESTATUSDETAILS']._serialized_start=4747
119
+ _globals['_FILESTATUSDETAILS']._serialized_end=5236
120
+ _globals['_EMPTY']._serialized_start=5238
121
+ _globals['_EMPTY']._serialized_end=5245
122
+ _globals['_FILESERVICE']._serialized_start=5823
123
+ _globals['_FILESERVICE']._serialized_end=7193
124
+ # @@protoc_insertion_point(module_scope)
@@ -83,6 +83,7 @@ message UploadUrlRequest {
83
83
  optional bool is_temporary = 7;
84
84
  optional int32 expire_seconds = 8;
85
85
  optional bool keep_original_filename = 9; // 保留原始文件名,默认false
86
+ optional bool forbid_overwrite = 10; // 防止覆盖同名文件,默认false
86
87
  }
87
88
 
88
89
  message UploadCompletedRequest {
@@ -118,6 +118,7 @@ class AsyncBlobService(BaseFileService):
118
118
  is_temporary: Optional[bool] = False,
119
119
  expire_seconds: Optional[int] = None,
120
120
  keep_original_filename: Optional[bool] = False,
121
+ forbid_overwrite: Optional[bool] = True,
121
122
  request_id: Optional[str] = None,
122
123
  **metadata
123
124
  ) -> FileUploadResponse:
@@ -134,6 +135,7 @@ class AsyncBlobService(BaseFileService):
134
135
  is_temporary=is_temporary,
135
136
  expire_seconds=expire_seconds if is_temporary and expire_seconds else None,
136
137
  keep_original_filename=keep_original_filename,
138
+ forbid_overwrite=forbid_overwrite,
137
139
  request_id=request_id,
138
140
  **metadata
139
141
  )
@@ -151,12 +153,13 @@ class AsyncBlobService(BaseFileService):
151
153
  "Cache-Control": "public, max-age=86400" # 24小时公共缓存
152
154
  }
153
155
 
154
- # 上传文件到对象存储
156
+ # 上传文件到对象存储,传递forbid_overwrite参数
155
157
  await self.http_uploader.upload(
156
158
  url=upload_url_resp.upload_url,
157
159
  content=content,
158
160
  headers=headers,
159
161
  total_size=file_size,
162
+ forbid_overwrite=forbid_overwrite,
160
163
  )
161
164
 
162
165
  # 确认上传完成
@@ -184,6 +187,7 @@ class AsyncBlobService(BaseFileService):
184
187
  is_temporary: Optional[bool] = False,
185
188
  expire_seconds: Optional[int] = None,
186
189
  keep_original_filename: Optional[bool] = False,
190
+ forbid_overwrite: Optional[bool] = False,
187
191
  request_id: Optional[str] = None,
188
192
  **metadata
189
193
  ) -> FileUploadResponse:
@@ -200,6 +204,7 @@ class AsyncBlobService(BaseFileService):
200
204
  is_temporary=is_temporary,
201
205
  expire_seconds=expire_seconds if is_temporary and expire_seconds else None,
202
206
  keep_original_filename=keep_original_filename,
207
+ forbid_overwrite=forbid_overwrite,
203
208
  request_id=request_id,
204
209
  **metadata
205
210
  )
@@ -224,12 +229,13 @@ class AsyncBlobService(BaseFileService):
224
229
  mime_type=mime_type,
225
230
  )
226
231
 
227
- # 上传文件到对象存储
232
+ # 上传文件到对象存储,传递forbid_overwrite参数
228
233
  await self.http_uploader.upload(
229
234
  url=upload_url,
230
235
  content=content,
231
236
  headers=headers,
232
237
  total_size=file_size,
238
+ forbid_overwrite=forbid_overwrite,
233
239
  )
234
240
 
235
241
  # 确认上传完成
@@ -277,6 +283,7 @@ class AsyncBlobService(BaseFileService):
277
283
  is_temporary: Optional[bool] = False,
278
284
  expire_seconds: Optional[int] = None,
279
285
  keep_original_filename: Optional[bool] = False,
286
+ forbid_overwrite: Optional[bool] = False,
280
287
  request_id: Optional[str] = None,
281
288
  **metadata
282
289
  ) -> UploadUrlResponse:
@@ -293,6 +300,7 @@ class AsyncBlobService(BaseFileService):
293
300
  is_temporary: 是否为临时文件
294
301
  expire_seconds: 过期秒数
295
302
  keep_original_filename: 是否保留原始文件名(默认False)
303
+ forbid_overwrite: 防止覆盖同名文件(默认False)
296
304
  request_id: 请求ID(可选,如果不提供则自动生成)
297
305
  **metadata: 额外的元数据(如 x-org-id, x-user-id 等)
298
306
 
@@ -312,6 +320,7 @@ class AsyncBlobService(BaseFileService):
312
320
  is_temporary=is_temporary,
313
321
  expire_seconds=expire_seconds if is_temporary and expire_seconds else None,
314
322
  keep_original_filename=keep_original_filename,
323
+ forbid_overwrite=forbid_overwrite,
315
324
  )
316
325
 
317
326
  if folder_id:
@@ -339,6 +348,7 @@ class AsyncBlobService(BaseFileService):
339
348
  is_temporary: Optional[bool] = False,
340
349
  expire_seconds: Optional[int] = None,
341
350
  keep_original_filename: Optional[bool] = False,
351
+ forbid_overwrite: Optional[bool] = False,
342
352
  request_id: Optional[str] = None,
343
353
  **metadata
344
354
  ) -> UploadUrlResponse:
@@ -355,6 +365,7 @@ class AsyncBlobService(BaseFileService):
355
365
  is_temporary: 是否为临时文件
356
366
  expire_seconds: 过期秒数
357
367
  keep_original_filename: 是否保留原始文件名(默认False)
368
+ forbid_overwrite: 防止覆盖同名文件(默认False)
358
369
  request_id: 请求ID(可选,如果不提供则自动生成)
359
370
  **metadata: 额外的元数据(如 x-org-id, x-user-id 等)
360
371
 
@@ -376,6 +387,7 @@ class AsyncBlobService(BaseFileService):
376
387
  is_temporary=is_temporary,
377
388
  expire_seconds=expire_seconds if is_temporary and expire_seconds else None,
378
389
  keep_original_filename=keep_original_filename,
390
+ forbid_overwrite=forbid_overwrite,
379
391
  )
380
392
 
381
393
  if folder_id:
@@ -401,6 +413,7 @@ class AsyncBlobService(BaseFileService):
401
413
  is_temporary: Optional[bool] = False,
402
414
  expire_seconds: Optional[int] = None,
403
415
  keep_original_filename: Optional[bool] = False,
416
+ forbid_overwrite: Optional[bool] = True,
404
417
  url: Optional[str] = None,
405
418
  file_name: Optional[str] = None,
406
419
  mime_type: Optional[str] = None,
@@ -417,6 +430,7 @@ class AsyncBlobService(BaseFileService):
417
430
  is_temporary: 是否为临时文件
418
431
  expire_seconds: 过期秒数
419
432
  keep_original_filename: 是否保留原始文件名(默认False)
433
+ forbid_overwrite: 防止覆盖同名文件(默认False)
420
434
  url: 要下载并上传的URL(可选)
421
435
  file_name: 当使用url参数时指定的文件名(可选)
422
436
  mime_type: MIME类型(可选,用于推断文件扩展名,特别适用于AI生成的字节数据)
@@ -511,8 +525,16 @@ class AsyncBlobService(BaseFileService):
511
525
  hundred_mb = 1024 * 1024 * 100
512
526
  if file_size >= ten_mb and file_size < hundred_mb: # 10MB
513
527
  mode = UploadMode.STREAM # 大文件自动使用流式上传模式
528
+ # 暂时屏蔽 RESUMABLE 模式,因为OSS断点续传尚未完成开发
529
+ # elif file_size > hundred_mb:
530
+ # mode = UploadMode.RESUMABLE # 特大文件自动使用断点续传模式
514
531
  elif file_size > hundred_mb:
515
- mode = UploadMode.RESUMABLE # 特大文件自动使用断点续传模式
532
+ mode = UploadMode.STREAM # 暂时使用流式上传代替断点续传
533
+
534
+ # OSS断点续传尚未完成,将RESUMABLE模式自动转为STREAM模式
535
+ if mode == UploadMode.RESUMABLE:
536
+ mode = UploadMode.STREAM
537
+ # TODO: 当OSS断点续传功能完成后,移除此转换逻辑
516
538
 
517
539
  # 根据上传模式执行不同的上传逻辑
518
540
  if mode == UploadMode.NORMAL:
@@ -543,6 +565,7 @@ class AsyncBlobService(BaseFileService):
543
565
  is_temporary=is_temporary,
544
566
  expire_seconds=expire_seconds,
545
567
  keep_original_filename=keep_original_filename,
568
+ forbid_overwrite=forbid_overwrite,
546
569
  request_id=request_id,
547
570
  **metadata
548
571
  )
@@ -560,6 +583,7 @@ class AsyncBlobService(BaseFileService):
560
583
  is_temporary=is_temporary,
561
584
  expire_seconds=expire_seconds,
562
585
  keep_original_filename=keep_original_filename,
586
+ forbid_overwrite=forbid_overwrite,
563
587
  request_id=request_id,
564
588
  **metadata
565
589
  )
@@ -116,6 +116,7 @@ class SyncBlobService(BaseFileService):
116
116
  is_temporary: Optional[bool] = False,
117
117
  expire_seconds: Optional[int] = None,
118
118
  keep_original_filename: Optional[bool] = False,
119
+ forbid_overwrite: Optional[bool] = True,
119
120
  request_id: Optional[str] = None,
120
121
  **metadata
121
122
  ) -> FileUploadResponse:
@@ -132,6 +133,7 @@ class SyncBlobService(BaseFileService):
132
133
  is_temporary=is_temporary,
133
134
  expire_seconds=expire_seconds if is_temporary and expire_seconds else None,
134
135
  keep_original_filename=keep_original_filename,
136
+ forbid_overwrite=forbid_overwrite,
135
137
  request_id=request_id,
136
138
  **metadata
137
139
  )
@@ -149,12 +151,13 @@ class SyncBlobService(BaseFileService):
149
151
  "Cache-Control": "public, max-age=86400" # 24小时公共缓存
150
152
  }
151
153
 
152
- # 上传文件到对象存储
154
+ # 上传文件到对象存储,传递forbid_overwrite参数
153
155
  self.http_uploader.upload(
154
156
  url=upload_url_resp.upload_url,
155
157
  content=content,
156
158
  headers=headers,
157
159
  total_size=file_size,
160
+ forbid_overwrite=forbid_overwrite,
158
161
  )
159
162
 
160
163
  # 确认上传完成
@@ -182,6 +185,7 @@ class SyncBlobService(BaseFileService):
182
185
  is_temporary: Optional[bool] = False,
183
186
  expire_seconds: Optional[int] = None,
184
187
  keep_original_filename: Optional[bool] = False,
188
+ forbid_overwrite: Optional[bool] = False,
185
189
  request_id: Optional[str] = None,
186
190
  **metadata
187
191
  ) -> FileUploadResponse:
@@ -198,6 +202,7 @@ class SyncBlobService(BaseFileService):
198
202
  is_temporary=is_temporary,
199
203
  expire_seconds=expire_seconds if is_temporary and expire_seconds else None,
200
204
  keep_original_filename=keep_original_filename,
205
+ forbid_overwrite=forbid_overwrite,
201
206
  request_id=request_id,
202
207
  **metadata
203
208
  )
@@ -222,13 +227,14 @@ class SyncBlobService(BaseFileService):
222
227
  mime_type=mime_type,
223
228
  )
224
229
 
225
- # 上传文件到对象存储
230
+ # 上传文件到对象存储,传递forbid_overwrite参数
226
231
  self.http_uploader.upload(
227
232
  url=upload_url,
228
233
  content=content,
229
234
  headers=headers,
230
235
  total_size=file_size,
231
- is_resume=True
236
+ is_resume=True,
237
+ forbid_overwrite=forbid_overwrite,
232
238
  )
233
239
 
234
240
  # 确认上传完成
@@ -276,6 +282,7 @@ class SyncBlobService(BaseFileService):
276
282
  is_temporary: Optional[bool] = False,
277
283
  expire_seconds: Optional[int] = None,
278
284
  keep_original_filename: Optional[bool] = False,
285
+ forbid_overwrite: Optional[bool] = False,
279
286
  request_id: Optional[str] = None,
280
287
  **metadata
281
288
  ) -> UploadUrlResponse:
@@ -292,6 +299,7 @@ class SyncBlobService(BaseFileService):
292
299
  is_temporary: 是否为临时文件
293
300
  expire_seconds: 过期秒数
294
301
  keep_original_filename: 是否保留原始文件名(默认False)
302
+ forbid_overwrite: 防止覆盖同名文件(默认False)
295
303
  request_id: 请求ID(可选,如果不提供则自动生成)
296
304
  **metadata: 额外的元数据(如 x-org-id, x-user-id 等)
297
305
 
@@ -311,6 +319,7 @@ class SyncBlobService(BaseFileService):
311
319
  is_temporary=is_temporary,
312
320
  expire_seconds=expire_seconds if is_temporary and expire_seconds else None,
313
321
  keep_original_filename=keep_original_filename,
322
+ forbid_overwrite=forbid_overwrite,
314
323
  )
315
324
 
316
325
  if folder_id:
@@ -338,6 +347,7 @@ class SyncBlobService(BaseFileService):
338
347
  is_temporary: Optional[bool] = False,
339
348
  expire_seconds: Optional[int] = None,
340
349
  keep_original_filename: Optional[bool] = False,
350
+ forbid_overwrite: Optional[bool] = False,
341
351
  request_id: Optional[str] = None,
342
352
  **metadata
343
353
  ) -> UploadUrlResponse:
@@ -354,6 +364,7 @@ class SyncBlobService(BaseFileService):
354
364
  is_temporary: 是否为临时文件
355
365
  expire_seconds: 过期秒数
356
366
  keep_original_filename: 是否保留原始文件名(默认False)
367
+ forbid_overwrite: 防止覆盖同名文件(默认False)
357
368
  request_id: 请求ID(可选,如果不提供则自动生成)
358
369
  **metadata: 额外的元数据(如 x-org-id, x-user-id 等)
359
370
 
@@ -375,6 +386,7 @@ class SyncBlobService(BaseFileService):
375
386
  is_temporary=is_temporary,
376
387
  expire_seconds=expire_seconds if is_temporary and expire_seconds else None,
377
388
  keep_original_filename=keep_original_filename,
389
+ forbid_overwrite=forbid_overwrite,
378
390
  )
379
391
 
380
392
  if folder_id:
@@ -400,6 +412,7 @@ class SyncBlobService(BaseFileService):
400
412
  is_temporary: Optional[bool] = False,
401
413
  expire_seconds: Optional[int] = None,
402
414
  keep_original_filename: Optional[bool] = False,
415
+ forbid_overwrite: Optional[bool] = True,
403
416
  url: Optional[str] = None,
404
417
  file_name: Optional[str] = None,
405
418
  mime_type: Optional[str] = None,
@@ -416,6 +429,7 @@ class SyncBlobService(BaseFileService):
416
429
  is_temporary: 是否为临时文件
417
430
  expire_seconds: 过期秒数
418
431
  keep_original_filename: 是否保留原始文件名(默认False)
432
+ forbid_overwrite: 防止覆盖同名文件(默认False)
419
433
  url: 要下载并上传的URL(可选)
420
434
  file_name: 当使用url参数时指定的文件名(可选)
421
435
  mime_type: MIME类型(可选,用于推断文件扩展名,特别适用于AI生成的字节数据)
@@ -510,8 +524,16 @@ class SyncBlobService(BaseFileService):
510
524
  hundred_mb = 1024 * 1024 * 100
511
525
  if file_size >= ten_mb and file_size < hundred_mb: # 10MB
512
526
  mode = UploadMode.STREAM # 大文件自动使用流式上传模式
527
+ # 暂时屏蔽 RESUMABLE 模式,因为OSS断点续传尚未完成开发
528
+ # elif file_size > hundred_mb:
529
+ # mode = UploadMode.RESUMABLE # 特大文件自动使用断点续传模式
513
530
  elif file_size > hundred_mb:
514
- mode = UploadMode.RESUMABLE # 特大文件自动使用断点续传模式
531
+ mode = UploadMode.STREAM # 暂时使用流式上传代替断点续传
532
+
533
+ # OSS断点续传尚未完成,将RESUMABLE模式自动转为STREAM模式
534
+ if mode == UploadMode.RESUMABLE:
535
+ mode = UploadMode.STREAM
536
+ # TODO: 当OSS断点续传功能完成后,移除此转换逻辑
515
537
 
516
538
  # 根据上传模式执行不同的上传逻辑
517
539
  if mode == UploadMode.NORMAL:
@@ -542,6 +564,7 @@ class SyncBlobService(BaseFileService):
542
564
  is_temporary=is_temporary,
543
565
  expire_seconds=expire_seconds if is_temporary and expire_seconds else None,
544
566
  keep_original_filename=keep_original_filename,
567
+ forbid_overwrite=forbid_overwrite,
545
568
  request_id=request_id,
546
569
  **metadata
547
570
  )
@@ -559,6 +582,7 @@ class SyncBlobService(BaseFileService):
559
582
  is_temporary=is_temporary,
560
583
  expire_seconds=expire_seconds if is_temporary and expire_seconds else None,
561
584
  keep_original_filename=keep_original_filename,
585
+ forbid_overwrite=forbid_overwrite,
562
586
  request_id=request_id,
563
587
  **metadata
564
588
  )
@@ -115,22 +115,18 @@ def setup_logging(
115
115
 
116
116
  # 初始化日志(使用JSON格式)
117
117
  if enable_grpc_logging:
118
- log_record = logging.LogRecord(
119
- name=logger.name,
120
- level=logging.INFO,
121
- pathname="",
122
- lineno=0,
123
- msg="📡 文件中心客户端 gRPC 日志已初始化",
124
- args=(),
125
- exc_info=None
118
+ # 使用 logger.debug() 以遵守日志级别设置
119
+ logger.debug(
120
+ "📡 文件中心客户端 gRPC 日志已初始化",
121
+ extra={
122
+ "log_type": "debug",
123
+ "data": {
124
+ "level": level,
125
+ "grpc_logging": enable_grpc_logging,
126
+ "json_format": use_json_format
127
+ }
128
+ }
126
129
  )
127
- log_record.log_type = "info"
128
- log_record.data = {
129
- "level": level,
130
- "grpc_logging": enable_grpc_logging,
131
- "json_format": use_json_format
132
- }
133
- logger.handle(log_record)
134
130
 
135
131
 
136
132
  def get_logger() -> logging.Logger:
@@ -9,11 +9,61 @@ import asyncio
9
9
  import aiohttp
10
10
  import requests
11
11
  from pathlib import Path
12
- from typing import Union, BinaryIO, Optional, Callable, Dict, Any, AsyncGenerator
12
+ from typing import Union, BinaryIO, Optional, Callable, Dict, Any, AsyncGenerator, Tuple
13
13
  from dataclasses import dataclass
14
14
  import hashlib
15
15
 
16
16
 
17
+ def detect_storage_type(url: str) -> str:
18
+ """
19
+ 根据URL检测存储类型
20
+
21
+ Args:
22
+ url: 上传URL
23
+
24
+ Returns:
25
+ 存储类型: 'gcs'、'oss' 或 'unknown'
26
+ """
27
+ if 'storage.googleapis.com' in url or 'storage.cloud.google.com' in url:
28
+ return 'gcs'
29
+ elif 'aliyuncs.com' in url:
30
+ return 'oss'
31
+ else:
32
+ return 'gcs'
33
+
34
+
35
+ def get_forbid_overwrite_headers(url: str, forbid_overwrite: bool = False) -> Dict[str, str]:
36
+ """
37
+ 获取防止覆盖的headers
38
+
39
+ Args:
40
+ url: 上传URL
41
+ forbid_overwrite: 是否防止覆盖
42
+
43
+ Returns:
44
+ 包含防止覆盖header的字典
45
+
46
+ Note:
47
+ - GCS: 需要在HTTP header中添加 x-goog-if-generation-match: 0
48
+ - OSS: 需要在HTTP header中添加 x-oss-forbid-overwrite: true
49
+ """
50
+ if not forbid_overwrite:
51
+ return {}
52
+
53
+ storage_type = detect_storage_type(url)
54
+
55
+ if storage_type == 'gcs':
56
+ return {
57
+ 'x-goog-if-generation-match': '0'
58
+ }
59
+ elif storage_type == 'oss':
60
+ return {
61
+ 'x-oss-forbid-overwrite': 'true'
62
+ }
63
+ else:
64
+ return {}
65
+
66
+
17
67
  @dataclass
18
68
  class UploadProgress:
19
69
  """上传进度信息"""
@@ -127,10 +177,11 @@ class HttpUploader:
127
177
  progress_callback: Optional[Callable[[UploadProgress], None]] = None,
128
178
  total_size: Optional[int] = None,
129
179
  is_resume: bool = False,
180
+ forbid_overwrite: bool = False,
130
181
  ) -> requests.Response:
131
182
  """
132
183
  上传文件到指定URL
133
-
184
+
134
185
  Args:
135
186
  url: 上传URL
136
187
  content: 文件内容
@@ -138,9 +189,15 @@ class HttpUploader:
138
189
  headers: 请求头
139
190
  progress_callback: 进度回调函数
140
191
  is_resume: 是否断点续传
192
+ forbid_overwrite: 是否防止覆盖(添加相应的header)
141
193
  """
142
194
  headers = headers or {}
143
195
 
196
+ # 添加防止覆盖的headers
197
+ if forbid_overwrite:
198
+ forbid_headers = get_forbid_overwrite_headers(url, forbid_overwrite)
199
+ headers.update(forbid_headers)
200
+
144
201
  # 获取文件大小(不生成 chunk,避免提前读取)
145
202
  final_total_size = self._calculate_total_size(content) if total_size is None else total_size
146
203
 
@@ -360,19 +417,26 @@ class AsyncHttpUploader:
360
417
  progress_callback: Optional[Callable[[UploadProgress], None]] = None,
361
418
  total_size: Optional[int] = None,
362
419
  is_resume: bool = False,
420
+ forbid_overwrite: bool = False,
363
421
  ) -> aiohttp.ClientResponse:
364
422
  """
365
423
  异步上传文件到指定URL
366
-
424
+
367
425
  Args:
368
426
  url: 上传URL
369
427
  content: 文件内容
370
428
  headers: 请求头
371
429
  progress_callback: 进度回调函数
372
430
  is_resume: 是否断点续传
431
+ forbid_overwrite: 是否防止覆盖(添加相应的header)
373
432
  """
374
433
  headers = headers or {}
375
434
 
435
+ # 添加防止覆盖的headers
436
+ if forbid_overwrite:
437
+ forbid_headers = get_forbid_overwrite_headers(url, forbid_overwrite)
438
+ headers.update(forbid_headers)
439
+
376
440
  # 获取文件大小(避免读取内容)
377
441
  final_total_size = total_size or await self._calculate_total_size(content)
378
442
 
@@ -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.2.1",
5
+ version="0.2.2",
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.2.1
3
+ Version: 0.2.2
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
@@ -1,124 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- # Generated by the protocol buffer compiler. DO NOT EDIT!
3
- # NO CHECKED-IN PROTOBUF GENCODE
4
- # source: file_service.proto
5
- # Protobuf Python Version: 5.27.2
6
- """Generated protocol buffer code."""
7
- from google.protobuf import descriptor as _descriptor
8
- from google.protobuf import descriptor_pool as _descriptor_pool
9
- from google.protobuf import runtime_version as _runtime_version
10
- from google.protobuf import symbol_database as _symbol_database
11
- from google.protobuf.internal import builder as _builder
12
- _runtime_version.ValidateProtobufRuntimeVersion(
13
- _runtime_version.Domain.PUBLIC,
14
- 5,
15
- 27,
16
- 2,
17
- '',
18
- 'file_service.proto'
19
- )
20
- # @@protoc_insertion_point(imports)
21
-
22
- _sym_db = _symbol_database.Default()
23
-
24
-
25
- from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2
26
- from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2
27
-
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\"\x9f\x02\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\x12#\n\x16keep_original_filename\x18\x08 \x01(\x08H\x03\x88\x01\x01\x42\x0c\n\n_folder_idB\x0f\n\r_is_temporaryB\x11\n\x0f_expire_secondsB\x19\n\x17_keep_original_filename\"\xb3\x02\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\x12#\n\x16keep_original_filename\x18\t \x01(\x08H\x03\x88\x01\x01\x42\x0c\n\n_folder_idB\x0f\n\r_is_temporaryB\x11\n\x0f_expire_secondsB\x19\n\x17_keep_original_filename\")\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\"{\n\x17\x42\x61tchDownloadUrlRequest\x12\x10\n\x08\x66ile_ids\x18\x01 \x03(\t\x12\x13\n\x06is_cdn\x18\x02 \x01(\x08H\x00\x88\x01\x01\x12\x1b\n\x0e\x65xpire_seconds\x18\x03 \x01(\x05H\x01\x88\x01\x01\x42\t\n\x07_is_cdnB\x11\n\x0f_expire_seconds\"#\n\x10GetGcsUrlRequest\x12\x0f\n\x07\x66ile_id\x18\x01 \x01(\t\")\n\x15\x42\x61tchGetGcsUrlRequest\x12\x10\n\x08\x66ile_ids\x18\x01 \x03(\t\"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\"H\n\x18\x42\x61tchDownloadUrlResponse\x12,\n\rdownload_urls\x18\x01 \x03(\x0b\x32\x15.file.DownloadUrlInfo\"`\n\x0f\x44ownloadUrlInfo\x12\x0f\n\x07\x66ile_id\x18\x01 \x01(\t\x12\x0b\n\x03url\x18\x02 \x01(\t\x12\x11\n\tmime_type\x18\x03 \x01(\t\x12\x12\n\x05\x65rror\x18\x04 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_error\"7\n\x11GetGcsUrlResponse\x12\x0f\n\x07gcs_url\x18\x01 \x01(\t\x12\x11\n\tmime_type\x18\x02 \x01(\t\"<\n\x16\x42\x61tchGetGcsUrlResponse\x12\"\n\x08gcs_urls\x18\x01 \x03(\x0b\x32\x10.file.GcsUrlInfo\"_\n\nGcsUrlInfo\x12\x0f\n\x07\x66ile_id\x18\x01 \x01(\t\x12\x0f\n\x07gcs_url\x18\x02 \x01(\t\x12\x11\n\tmime_type\x18\x03 \x01(\t\x12\x12\n\x05\x65rror\x18\x04 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_error\"+\n\x18\x43ompressionStatusRequest\x12\x0f\n\x07\x66ile_id\x18\x01 \x01(\t\"\x84\x01\n\x19\x43ompressionStatusResponse\x12\x0e\n\x06status\x18\x01 \x01(\t\x12\x1a\n\rerror_message\x18\x02 \x01(\tH\x00\x88\x01\x01\x12)\n\x08variants\x18\x03 \x03(\x0b\x32\x17.file.CompressedVariantB\x10\n\x0e_error_message\"Q\n\x12GetVariantsRequest\x12\x0f\n\x07\x66ile_id\x18\x01 \x01(\t\x12\x19\n\x0cvariant_type\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0f\n\r_variant_type\"@\n\x13GetVariantsResponse\x12)\n\x08variants\x18\x01 \x03(\x0b\x32\x17.file.CompressedVariant\"\xc7\x02\n\x11\x43ompressedVariant\x12\x14\n\x0cvariant_name\x18\x01 \x01(\t\x12\x14\n\x0cvariant_type\x18\x02 \x01(\t\x12\x12\n\nmedia_type\x18\x03 \x01(\t\x12\r\n\x05width\x18\x04 \x01(\x05\x12\x0e\n\x06height\x18\x05 \x01(\x05\x12\x11\n\tfile_size\x18\x06 \x01(\x03\x12\x0e\n\x06\x66ormat\x18\x07 \x01(\t\x12\x14\n\x07quality\x18\x08 \x01(\x05H\x00\x88\x01\x01\x12\x15\n\x08\x64uration\x18\t \x01(\x01H\x01\x88\x01\x01\x12\x14\n\x07\x62itrate\x18\n \x01(\x03H\x02\x88\x01\x01\x12\x10\n\x03\x66ps\x18\x0b \x01(\x05H\x03\x88\x01\x01\x12\x19\n\x11\x63ompression_ratio\x18\x0c \x01(\x01\x12\x13\n\x0bstored_path\x18\r \x01(\tB\n\n\x08_qualityB\x0b\n\t_durationB\n\n\x08_bitrateB\x06\n\x04_fps\"Y\n\x14RecompressionRequest\x12\x0f\n\x07\x66ile_id\x18\x01 \x01(\t\x12\x1c\n\x0f\x66orce_reprocess\x18\x02 \x01(\x08H\x00\x88\x01\x01\x42\x12\n\x10_force_reprocess\"8\n\x15RecompressionResponse\x12\x0f\n\x07task_id\x18\x01 \x01(\t\x12\x0e\n\x06status\x18\x02 \x01(\t\"\x92\x01\n\x19VariantDownloadUrlRequest\x12\x0f\n\x07\x66ile_id\x18\x01 \x01(\t\x12\x14\n\x0cvariant_name\x18\x02 \x01(\t\x12\x1b\n\x0e\x65xpire_seconds\x18\x03 \x01(\x05H\x00\x88\x01\x01\x12\x13\n\x06is_cdn\x18\x04 \x01(\x08H\x01\x88\x01\x01\x42\x11\n\x0f_expire_secondsB\t\n\x07_is_cdn\"\x8c\x01\n\x1aVariantDownloadUrlResponse\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\x12\n\x05\x65rror\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x32\n\x0cvariant_info\x18\x03 \x01(\x0b\x32\x17.file.CompressedVariantH\x01\x88\x01\x01\x42\x08\n\x06_errorB\x0f\n\r_variant_info\"\\\n\x16\x42\x61tchFileStatusRequest\x12\x10\n\x08\x66ile_ids\x18\x01 \x03(\t\x12\x1c\n\x0finclude_details\x18\x02 \x01(\x08H\x00\x88\x01\x01\x42\x12\n\x10_include_details\"m\n\x17\x42\x61tchFileStatusResponse\x12&\n\x08statuses\x18\x01 \x03(\x0b\x32\x14.file.FileStatusInfo\x12\x11\n\ttimestamp\x18\x02 \x01(\x03\x12\x17\n\x0f\x63\x61\x63he_hit_count\x18\x03 \x01(\x05\"\x9d\x02\n\x0e\x46ileStatusInfo\x12\x0f\n\x07\x66ile_id\x18\x01 \x01(\t\x12-\n\rupload_status\x18\x02 \x01(\x0e\x32\x16.file.FileUploadStatus\x12\x37\n\x12\x63ompression_status\x18\x03 \x01(\x0e\x32\x1b.file.FileCompressionStatus\x12)\n\x0bsync_status\x18\x04 \x01(\x0e\x32\x14.file.FileSyncStatus\x12-\n\x07\x64\x65tails\x18\x05 \x01(\x0b\x32\x17.file.FileStatusDetailsH\x00\x88\x01\x01\x12\x1a\n\rerror_message\x18\x06 \x01(\tH\x01\x88\x01\x01\x42\n\n\x08_detailsB\x10\n\x0e_error_message\"\xe9\x03\n\x11\x46ileStatusDetails\x12\x16\n\tfile_size\x18\x01 \x01(\x03H\x00\x88\x01\x01\x12\x19\n\x0cstorage_type\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x1b\n\x0estorage_region\x18\x03 \x01(\tH\x02\x88\x01\x01\x12 \n\x13\x63ompression_task_id\x18\x04 \x01(\tH\x03\x88\x01\x01\x12\'\n\x1a\x63ompression_variants_count\x18\x05 \x01(\x05H\x04\x88\x01\x01\x12!\n\x14\x63ompression_progress\x18\x06 \x01(\x01H\x05\x88\x01\x01\x12\x1f\n\x12sync_regions_total\x18\x07 \x01(\x05H\x06\x88\x01\x01\x12#\n\x16sync_regions_completed\x18\x08 \x01(\x05H\x07\x88\x01\x01\x12\x1c\n\x14sync_pending_regions\x18\t \x03(\tB\x0c\n\n_file_sizeB\x0f\n\r_storage_typeB\x11\n\x0f_storage_regionB\x16\n\x14_compression_task_idB\x1d\n\x1b_compression_variants_countB\x17\n\x15_compression_progressB\x15\n\x13_sync_regions_totalB\x19\n\x17_sync_regions_completed\"\x07\n\x05\x45mpty*\x95\x01\n\x10\x46ileUploadStatus\x12\x12\n\x0eUPLOAD_UNKNOWN\x10\x00\x12\x12\n\x0eUPLOAD_PENDING\x10\x01\x12\x15\n\x11UPLOAD_PROCESSING\x10\x02\x12\x14\n\x10UPLOAD_COMPLETED\x10\x03\x12\x11\n\rUPLOAD_FAILED\x10\x04\x12\x19\n\x15UPLOAD_FILE_NOT_FOUND\x10\x05*\xf1\x01\n\x15\x46ileCompressionStatus\x12\x17\n\x13\x43OMPRESSION_UNKNOWN\x10\x00\x12\x1e\n\x1a\x43OMPRESSION_NOT_APPLICABLE\x10\x01\x12\x17\n\x13\x43OMPRESSION_PENDING\x10\x02\x12\x1a\n\x16\x43OMPRESSION_PROCESSING\x10\x03\x12\x19\n\x15\x43OMPRESSION_COMPLETED\x10\x04\x12\x16\n\x12\x43OMPRESSION_FAILED\x10\x05\x12\x17\n\x13\x43OMPRESSION_SKIPPED\x10\x06\x12\x1e\n\x1a\x43OMPRESSION_FILE_NOT_FOUND\x10\x07*\xb0\x01\n\x0e\x46ileSyncStatus\x12\x10\n\x0cSYNC_UNKNOWN\x10\x00\x12\x15\n\x11SYNC_NOT_REQUIRED\x10\x01\x12\x10\n\x0cSYNC_PENDING\x10\x02\x12\x13\n\x0fSYNC_PROCESSING\x10\x03\x12\x10\n\x0cSYNC_PARTIAL\x10\x04\x12\x12\n\x0eSYNC_COMPLETED\x10\x05\x12\x0f\n\x0bSYNC_FAILED\x10\x06\x12\x17\n\x13SYNC_FILE_NOT_FOUND\x10\x07\x32\xda\n\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\x12Y\n\x18\x42\x61tchGenerateDownloadUrl\x12\x1d.file.BatchDownloadUrlRequest\x1a\x1e.file.BatchDownloadUrlResponse\x12<\n\tGetGcsUrl\x12\x16.file.GetGcsUrlRequest\x1a\x17.file.GetGcsUrlResponse\x12K\n\x0e\x42\x61tchGetGcsUrl\x12\x1b.file.BatchGetGcsUrlRequest\x1a\x1c.file.BatchGetGcsUrlResponse\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.FileListResponse\x12W\n\x14GetCompressionStatus\x12\x1e.file.CompressionStatusRequest\x1a\x1f.file.CompressionStatusResponse\x12L\n\x15GetCompressedVariants\x12\x18.file.GetVariantsRequest\x1a\x19.file.GetVariantsResponse\x12O\n\x14TriggerRecompression\x12\x1a.file.RecompressionRequest\x1a\x1b.file.RecompressionResponse\x12_\n\x1aGenerateVariantDownloadUrl\x12\x1f.file.VariantDownloadUrlRequest\x1a .file.VariantDownloadUrlResponse\x12Q\n\x12\x42\x61tchGetFileStatus\x12\x1c.file.BatchFileStatusRequest\x1a\x1d.file.BatchFileStatusResponseb\x06proto3')
30
-
31
- _globals = globals()
32
- _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
33
- _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'file_service_pb2', _globals)
34
- if not _descriptor._USE_C_DESCRIPTORS:
35
- DESCRIPTOR._loaded_options = None
36
- _globals['_FILEUPLOADSTATUS']._serialized_start=5196
37
- _globals['_FILEUPLOADSTATUS']._serialized_end=5345
38
- _globals['_FILECOMPRESSIONSTATUS']._serialized_start=5348
39
- _globals['_FILECOMPRESSIONSTATUS']._serialized_end=5589
40
- _globals['_FILESYNCSTATUS']._serialized_start=5592
41
- _globals['_FILESYNCSTATUS']._serialized_end=5768
42
- _globals['_FILE']._serialized_start=92
43
- _globals['_FILE']._serialized_end=263
44
- _globals['_UPLOADFILE']._serialized_start=266
45
- _globals['_UPLOADFILE']._serialized_end=577
46
- _globals['_UPLOADFILEREQUEST']._serialized_start=580
47
- _globals['_UPLOADFILEREQUEST']._serialized_end=867
48
- _globals['_UPLOADURLREQUEST']._serialized_start=870
49
- _globals['_UPLOADURLREQUEST']._serialized_end=1177
50
- _globals['_UPLOADCOMPLETEDREQUEST']._serialized_start=1179
51
- _globals['_UPLOADCOMPLETEDREQUEST']._serialized_end=1220
52
- _globals['_DOWNLOADURLREQUEST']._serialized_start=1222
53
- _globals['_DOWNLOADURLREQUEST']._serialized_end=1339
54
- _globals['_SHARELINKREQUEST']._serialized_start=1342
55
- _globals['_SHARELINKREQUEST']._serialized_end=1554
56
- _globals['_FILEVISITREQUEST']._serialized_start=1557
57
- _globals['_FILEVISITREQUEST']._serialized_end=1687
58
- _globals['_GETFILEREQUEST']._serialized_start=1689
59
- _globals['_GETFILEREQUEST']._serialized_end=1722
60
- _globals['_RENAMEFILEREQUEST']._serialized_start=1724
61
- _globals['_RENAMEFILEREQUEST']._serialized_end=1778
62
- _globals['_DELETEFILEREQUEST']._serialized_start=1780
63
- _globals['_DELETEFILEREQUEST']._serialized_end=1816
64
- _globals['_LISTFILESREQUEST']._serialized_start=1819
65
- _globals['_LISTFILESREQUEST']._serialized_end=2088
66
- _globals['_BATCHDOWNLOADURLREQUEST']._serialized_start=2090
67
- _globals['_BATCHDOWNLOADURLREQUEST']._serialized_end=2213
68
- _globals['_GETGCSURLREQUEST']._serialized_start=2215
69
- _globals['_GETGCSURLREQUEST']._serialized_end=2250
70
- _globals['_BATCHGETGCSURLREQUEST']._serialized_start=2252
71
- _globals['_BATCHGETGCSURLREQUEST']._serialized_end=2293
72
- _globals['_UPLOADFILERESPONSE']._serialized_start=2295
73
- _globals['_UPLOADFILERESPONSE']._serialized_end=2380
74
- _globals['_UPLOADURLRESPONSE']._serialized_start=2382
75
- _globals['_UPLOADURLRESPONSE']._serialized_end=2479
76
- _globals['_DOWNLOADURLRESPONSE']._serialized_start=2481
77
- _globals['_DOWNLOADURLRESPONSE']._serialized_end=2515
78
- _globals['_SHARELINKRESPONSE']._serialized_start=2517
79
- _globals['_SHARELINKRESPONSE']._serialized_end=2559
80
- _globals['_FILELISTRESPONSE']._serialized_start=2561
81
- _globals['_FILELISTRESPONSE']._serialized_end=2606
82
- _globals['_GETFILERESPONSE']._serialized_start=2608
83
- _globals['_GETFILERESPONSE']._serialized_end=2711
84
- _globals['_BATCHDOWNLOADURLRESPONSE']._serialized_start=2713
85
- _globals['_BATCHDOWNLOADURLRESPONSE']._serialized_end=2785
86
- _globals['_DOWNLOADURLINFO']._serialized_start=2787
87
- _globals['_DOWNLOADURLINFO']._serialized_end=2883
88
- _globals['_GETGCSURLRESPONSE']._serialized_start=2885
89
- _globals['_GETGCSURLRESPONSE']._serialized_end=2940
90
- _globals['_BATCHGETGCSURLRESPONSE']._serialized_start=2942
91
- _globals['_BATCHGETGCSURLRESPONSE']._serialized_end=3002
92
- _globals['_GCSURLINFO']._serialized_start=3004
93
- _globals['_GCSURLINFO']._serialized_end=3099
94
- _globals['_COMPRESSIONSTATUSREQUEST']._serialized_start=3101
95
- _globals['_COMPRESSIONSTATUSREQUEST']._serialized_end=3144
96
- _globals['_COMPRESSIONSTATUSRESPONSE']._serialized_start=3147
97
- _globals['_COMPRESSIONSTATUSRESPONSE']._serialized_end=3279
98
- _globals['_GETVARIANTSREQUEST']._serialized_start=3281
99
- _globals['_GETVARIANTSREQUEST']._serialized_end=3362
100
- _globals['_GETVARIANTSRESPONSE']._serialized_start=3364
101
- _globals['_GETVARIANTSRESPONSE']._serialized_end=3428
102
- _globals['_COMPRESSEDVARIANT']._serialized_start=3431
103
- _globals['_COMPRESSEDVARIANT']._serialized_end=3758
104
- _globals['_RECOMPRESSIONREQUEST']._serialized_start=3760
105
- _globals['_RECOMPRESSIONREQUEST']._serialized_end=3849
106
- _globals['_RECOMPRESSIONRESPONSE']._serialized_start=3851
107
- _globals['_RECOMPRESSIONRESPONSE']._serialized_end=3907
108
- _globals['_VARIANTDOWNLOADURLREQUEST']._serialized_start=3910
109
- _globals['_VARIANTDOWNLOADURLREQUEST']._serialized_end=4056
110
- _globals['_VARIANTDOWNLOADURLRESPONSE']._serialized_start=4059
111
- _globals['_VARIANTDOWNLOADURLRESPONSE']._serialized_end=4199
112
- _globals['_BATCHFILESTATUSREQUEST']._serialized_start=4201
113
- _globals['_BATCHFILESTATUSREQUEST']._serialized_end=4293
114
- _globals['_BATCHFILESTATUSRESPONSE']._serialized_start=4295
115
- _globals['_BATCHFILESTATUSRESPONSE']._serialized_end=4404
116
- _globals['_FILESTATUSINFO']._serialized_start=4407
117
- _globals['_FILESTATUSINFO']._serialized_end=4692
118
- _globals['_FILESTATUSDETAILS']._serialized_start=4695
119
- _globals['_FILESTATUSDETAILS']._serialized_end=5184
120
- _globals['_EMPTY']._serialized_start=5186
121
- _globals['_EMPTY']._serialized_end=5193
122
- _globals['_FILESERVICE']._serialized_start=5771
123
- _globals['_FILESERVICE']._serialized_end=7141
124
- # @@protoc_insertion_point(module_scope)