first commit
This commit is contained in:
32
app/media/schemas.py
Normal file
32
app/media/schemas.py
Normal file
@@ -0,0 +1,32 @@
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
|
||||
class UploadUrlRequest(BaseModel):
|
||||
file_name: str = Field(min_length=1, max_length=255)
|
||||
file_type: str = Field(min_length=1, max_length=64)
|
||||
file_size: int = Field(gt=0)
|
||||
|
||||
|
||||
class UploadUrlResponse(BaseModel):
|
||||
upload_url: str
|
||||
file_url: str
|
||||
object_key: str
|
||||
expires_in: int
|
||||
required_headers: dict[str, str]
|
||||
|
||||
|
||||
class AttachmentCreateRequest(BaseModel):
|
||||
message_id: int
|
||||
file_url: str = Field(min_length=1, max_length=1024)
|
||||
file_type: str = Field(min_length=1, max_length=64)
|
||||
file_size: int = Field(gt=0)
|
||||
|
||||
|
||||
class AttachmentRead(BaseModel):
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
id: int
|
||||
message_id: int
|
||||
file_url: str
|
||||
file_type: str
|
||||
file_size: int
|
||||
Reference in New Issue
Block a user