52ff2f80ad
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been cancelled
CI/CD Pipeline / Frontend Lint (push) Has been cancelled
Deploy / Deploy Staging (push) Has been cancelled
Deploy / Build Production Runtime Images (push) Has been cancelled
Deploy / Deploy Production (push) Has been cancelled
Deploy / Production Browser E2E (push) Has been cancelled
45 lines
2.0 KiB
Python
45 lines
2.0 KiB
Python
from datetime import datetime
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class ChunkedUploadInitRequest(BaseModel):
|
|
filename: str = Field(..., min_length=1, max_length=255, description="Filename")
|
|
file_size: int = Field(..., gt=0, le=2147483648, description="File size in bytes, max 2GB")
|
|
total_chunks: int = Field(..., gt=0, description="Total number of chunks")
|
|
content_type: str = Field(
|
|
default="application/octet-stream", min_length=1, max_length=100, description="Content type"
|
|
)
|
|
project_id: str = Field(..., min_length=1, description="Project ID")
|
|
library_id: str = Field(..., min_length=1, description="Asset library ID")
|
|
|
|
|
|
class ChunkedUploadInitResponse(BaseModel):
|
|
upload_id: str = Field(..., description="Upload ID")
|
|
chunk_size: int = Field(..., description="Chunk size in bytes")
|
|
total_chunks: int = Field(..., description="Total number of chunks")
|
|
filename: str = Field(..., description="Filename")
|
|
expires_at: datetime = Field(..., description="Expiration time")
|
|
|
|
|
|
class ChunkedUploadStatusResponse(BaseModel):
|
|
upload_id: str = Field(..., description="Upload ID")
|
|
filename: str = Field(..., description="Filename")
|
|
file_size: int = Field(..., description="File size")
|
|
total_chunks: int = Field(..., description="Total number of chunks")
|
|
uploaded_chunks: list[int] = Field(..., description="List of uploaded chunk indices")
|
|
status: str = Field(..., description="Upload status: pending/uploading/completed/failed")
|
|
created_at: datetime = Field(..., description="Creation time")
|
|
expires_at: datetime = Field(..., description="Expiration time")
|
|
|
|
|
|
class ChunkedUploadCompleteRequest(BaseModel):
|
|
project_id: str = Field(..., min_length=1, description="Project ID")
|
|
library_id: str = Field(..., min_length=1, description="Asset library ID")
|
|
|
|
|
|
class ChunkedUploadCompleteResponse(BaseModel):
|
|
storage_key: str = Field(..., description="Storage key")
|
|
ingest_job_id: str = Field(..., description="Ingest job ID")
|
|
url: str = Field(..., description="File URL")
|