tamar-file-hub-client 0.2.1__py3-none-any.whl → 0.2.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of tamar-file-hub-client might be problematic. Click here for more details.
- file_hub_client/rpc/gen/file_service_pb2.py +82 -82
- file_hub_client/rpc/protos/file_service.proto +1 -0
- file_hub_client/services/file/async_blob_service.py +27 -3
- file_hub_client/services/file/sync_blob_service.py +28 -4
- file_hub_client/utils/logging.py +11 -15
- file_hub_client/utils/upload_helper.py +67 -3
- tamar_file_hub_client-0.2.3.dist-info/METADATA +704 -0
- {tamar_file_hub_client-0.2.1.dist-info → tamar_file_hub_client-0.2.3.dist-info}/RECORD +10 -10
- tamar_file_hub_client-0.2.1.dist-info/METADATA +0 -2640
- {tamar_file_hub_client-0.2.1.dist-info → tamar_file_hub_client-0.2.3.dist-info}/WHEEL +0 -0
- {tamar_file_hub_client-0.2.1.dist-info → tamar_file_hub_client-0.2.3.dist-info}/top_level.txt +0 -0
|
@@ -26,19 +26,19 @@ 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\"\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')
|
|
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
30
|
|
|
31
31
|
_globals = globals()
|
|
32
32
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
33
33
|
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'file_service_pb2', _globals)
|
|
34
34
|
if not _descriptor._USE_C_DESCRIPTORS:
|
|
35
35
|
DESCRIPTOR._loaded_options = None
|
|
36
|
-
_globals['_FILEUPLOADSTATUS']._serialized_start=
|
|
37
|
-
_globals['_FILEUPLOADSTATUS']._serialized_end=
|
|
38
|
-
_globals['_FILECOMPRESSIONSTATUS']._serialized_start=
|
|
39
|
-
_globals['_FILECOMPRESSIONSTATUS']._serialized_end=
|
|
40
|
-
_globals['_FILESYNCSTATUS']._serialized_start=
|
|
41
|
-
_globals['_FILESYNCSTATUS']._serialized_end=
|
|
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
42
|
_globals['_FILE']._serialized_start=92
|
|
43
43
|
_globals['_FILE']._serialized_end=263
|
|
44
44
|
_globals['_UPLOADFILE']._serialized_start=266
|
|
@@ -46,79 +46,79 @@ if not _descriptor._USE_C_DESCRIPTORS:
|
|
|
46
46
|
_globals['_UPLOADFILEREQUEST']._serialized_start=580
|
|
47
47
|
_globals['_UPLOADFILEREQUEST']._serialized_end=867
|
|
48
48
|
_globals['_UPLOADURLREQUEST']._serialized_start=870
|
|
49
|
-
_globals['_UPLOADURLREQUEST']._serialized_end=
|
|
50
|
-
_globals['_UPLOADCOMPLETEDREQUEST']._serialized_start=
|
|
51
|
-
_globals['_UPLOADCOMPLETEDREQUEST']._serialized_end=
|
|
52
|
-
_globals['_DOWNLOADURLREQUEST']._serialized_start=
|
|
53
|
-
_globals['_DOWNLOADURLREQUEST']._serialized_end=
|
|
54
|
-
_globals['_SHARELINKREQUEST']._serialized_start=
|
|
55
|
-
_globals['_SHARELINKREQUEST']._serialized_end=
|
|
56
|
-
_globals['_FILEVISITREQUEST']._serialized_start=
|
|
57
|
-
_globals['_FILEVISITREQUEST']._serialized_end=
|
|
58
|
-
_globals['_GETFILEREQUEST']._serialized_start=
|
|
59
|
-
_globals['_GETFILEREQUEST']._serialized_end=
|
|
60
|
-
_globals['_RENAMEFILEREQUEST']._serialized_start=
|
|
61
|
-
_globals['_RENAMEFILEREQUEST']._serialized_end=
|
|
62
|
-
_globals['_DELETEFILEREQUEST']._serialized_start=
|
|
63
|
-
_globals['_DELETEFILEREQUEST']._serialized_end=
|
|
64
|
-
_globals['_LISTFILESREQUEST']._serialized_start=
|
|
65
|
-
_globals['_LISTFILESREQUEST']._serialized_end=
|
|
66
|
-
_globals['_BATCHDOWNLOADURLREQUEST']._serialized_start=
|
|
67
|
-
_globals['_BATCHDOWNLOADURLREQUEST']._serialized_end=
|
|
68
|
-
_globals['_GETGCSURLREQUEST']._serialized_start=
|
|
69
|
-
_globals['_GETGCSURLREQUEST']._serialized_end=
|
|
70
|
-
_globals['_BATCHGETGCSURLREQUEST']._serialized_start=
|
|
71
|
-
_globals['_BATCHGETGCSURLREQUEST']._serialized_end=
|
|
72
|
-
_globals['_UPLOADFILERESPONSE']._serialized_start=
|
|
73
|
-
_globals['_UPLOADFILERESPONSE']._serialized_end=
|
|
74
|
-
_globals['_UPLOADURLRESPONSE']._serialized_start=
|
|
75
|
-
_globals['_UPLOADURLRESPONSE']._serialized_end=
|
|
76
|
-
_globals['_DOWNLOADURLRESPONSE']._serialized_start=
|
|
77
|
-
_globals['_DOWNLOADURLRESPONSE']._serialized_end=
|
|
78
|
-
_globals['_SHARELINKRESPONSE']._serialized_start=
|
|
79
|
-
_globals['_SHARELINKRESPONSE']._serialized_end=
|
|
80
|
-
_globals['_FILELISTRESPONSE']._serialized_start=
|
|
81
|
-
_globals['_FILELISTRESPONSE']._serialized_end=
|
|
82
|
-
_globals['_GETFILERESPONSE']._serialized_start=
|
|
83
|
-
_globals['_GETFILERESPONSE']._serialized_end=
|
|
84
|
-
_globals['_BATCHDOWNLOADURLRESPONSE']._serialized_start=
|
|
85
|
-
_globals['_BATCHDOWNLOADURLRESPONSE']._serialized_end=
|
|
86
|
-
_globals['_DOWNLOADURLINFO']._serialized_start=
|
|
87
|
-
_globals['_DOWNLOADURLINFO']._serialized_end=
|
|
88
|
-
_globals['_GETGCSURLRESPONSE']._serialized_start=
|
|
89
|
-
_globals['_GETGCSURLRESPONSE']._serialized_end=
|
|
90
|
-
_globals['_BATCHGETGCSURLRESPONSE']._serialized_start=
|
|
91
|
-
_globals['_BATCHGETGCSURLRESPONSE']._serialized_end=
|
|
92
|
-
_globals['_GCSURLINFO']._serialized_start=
|
|
93
|
-
_globals['_GCSURLINFO']._serialized_end=
|
|
94
|
-
_globals['_COMPRESSIONSTATUSREQUEST']._serialized_start=
|
|
95
|
-
_globals['_COMPRESSIONSTATUSREQUEST']._serialized_end=
|
|
96
|
-
_globals['_COMPRESSIONSTATUSRESPONSE']._serialized_start=
|
|
97
|
-
_globals['_COMPRESSIONSTATUSRESPONSE']._serialized_end=
|
|
98
|
-
_globals['_GETVARIANTSREQUEST']._serialized_start=
|
|
99
|
-
_globals['_GETVARIANTSREQUEST']._serialized_end=
|
|
100
|
-
_globals['_GETVARIANTSRESPONSE']._serialized_start=
|
|
101
|
-
_globals['_GETVARIANTSRESPONSE']._serialized_end=
|
|
102
|
-
_globals['_COMPRESSEDVARIANT']._serialized_start=
|
|
103
|
-
_globals['_COMPRESSEDVARIANT']._serialized_end=
|
|
104
|
-
_globals['_RECOMPRESSIONREQUEST']._serialized_start=
|
|
105
|
-
_globals['_RECOMPRESSIONREQUEST']._serialized_end=
|
|
106
|
-
_globals['_RECOMPRESSIONRESPONSE']._serialized_start=
|
|
107
|
-
_globals['_RECOMPRESSIONRESPONSE']._serialized_end=
|
|
108
|
-
_globals['_VARIANTDOWNLOADURLREQUEST']._serialized_start=
|
|
109
|
-
_globals['_VARIANTDOWNLOADURLREQUEST']._serialized_end=
|
|
110
|
-
_globals['_VARIANTDOWNLOADURLRESPONSE']._serialized_start=
|
|
111
|
-
_globals['_VARIANTDOWNLOADURLRESPONSE']._serialized_end=
|
|
112
|
-
_globals['_BATCHFILESTATUSREQUEST']._serialized_start=
|
|
113
|
-
_globals['_BATCHFILESTATUSREQUEST']._serialized_end=
|
|
114
|
-
_globals['_BATCHFILESTATUSRESPONSE']._serialized_start=
|
|
115
|
-
_globals['_BATCHFILESTATUSRESPONSE']._serialized_end=
|
|
116
|
-
_globals['_FILESTATUSINFO']._serialized_start=
|
|
117
|
-
_globals['_FILESTATUSINFO']._serialized_end=
|
|
118
|
-
_globals['_FILESTATUSDETAILS']._serialized_start=
|
|
119
|
-
_globals['_FILESTATUSDETAILS']._serialized_end=
|
|
120
|
-
_globals['_EMPTY']._serialized_start=
|
|
121
|
-
_globals['_EMPTY']._serialized_end=
|
|
122
|
-
_globals['_FILESERVICE']._serialized_start=
|
|
123
|
-
_globals['_FILESERVICE']._serialized_end=
|
|
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
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] = True,
|
|
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.
|
|
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] = True,
|
|
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: 防止覆盖同名文件(默认True)
|
|
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: 防止覆盖同名文件(默认True)
|
|
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.
|
|
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
|
)
|
file_hub_client/utils/logging.py
CHANGED
|
@@ -115,22 +115,18 @@ def setup_logging(
|
|
|
115
115
|
|
|
116
116
|
# 初始化日志(使用JSON格式)
|
|
117
117
|
if enable_grpc_logging:
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
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:
|