0e59936e34
Co-authored-by: Cursor <cursoragent@cursor.com>
40 lines
799 B
Python
40 lines
799 B
Python
from datetime import datetime
|
|
from typing import Literal
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
TTLOption = Literal["1h", "24h", "7d", "never"]
|
|
|
|
|
|
class ItemCreate(BaseModel):
|
|
body: str = Field(min_length=1)
|
|
title: str | None = None
|
|
is_public: bool = True
|
|
burn_after_read: bool = False
|
|
ttl: TTLOption = "24h"
|
|
|
|
|
|
class ItemOut(BaseModel):
|
|
slug: str
|
|
kind: str
|
|
title: str
|
|
body: str | None = None
|
|
file_name: str | None = None
|
|
mime: str | None = None
|
|
size_bytes: int | None = None
|
|
is_public: bool
|
|
burn_after_read: bool
|
|
expires_at: datetime | None
|
|
created_at: datetime
|
|
view_count: int
|
|
|
|
model_config = {"from_attributes": True}
|
|
|
|
|
|
class WallResponse(BaseModel):
|
|
items: list[ItemOut]
|
|
page: int
|
|
page_size: int
|
|
total: int
|