32 lines
607 B
Python
32 lines
607 B
Python
import uuid
|
|
from datetime import datetime
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
from app.config import settings
|
|
|
|
|
|
class PasteCreate(BaseModel):
|
|
content: str = Field(..., min_length=1, max_length=settings.max_paste_length)
|
|
|
|
|
|
class PasteResponse(BaseModel):
|
|
id: uuid.UUID
|
|
content: str
|
|
created_at: datetime
|
|
|
|
model_config = {"from_attributes": True}
|
|
|
|
|
|
class PasteCreatedResponse(BaseModel):
|
|
id: uuid.UUID
|
|
delete_token: uuid.UUID
|
|
created_at: datetime
|
|
|
|
|
|
class PasteListResponse(BaseModel):
|
|
id: uuid.UUID
|
|
created_at: datetime
|
|
|
|
model_config = {"from_attributes": True}
|