WealthFromAI's picture
FORGE-X: Upload source (83499d7f-api.zip)
4794151 verified
Raw
History Blame Contribute Delete
1.33 kB
from pydantic import BaseModel, Field
from typing import Optional
from datetime import datetime
class ItemCreate(BaseModel):
name: str = Field(..., min_length=1, max_length=200, description="Item name")
description: Optional[str] = Field(None, max_length=2000)
category: Optional[str] = Field(None, max_length=100)
tags: list[str] = Field(default_factory=list)
metadata: dict = Field(default_factory=dict)
model_config = {"json_schema_extra": {"example": {
"name": "Sample Item",
"description": "A sample no_code_tools item",
"category": "default",
"tags": ["no_code_tools"],
"metadata": {},
}}}
class ItemUpdate(BaseModel):
name: Optional[str] = Field(None, min_length=1, max_length=200)
description: Optional[str] = Field(None, max_length=2000)
category: Optional[str] = None
tags: Optional[list[str]] = None
metadata: Optional[dict] = None
class ItemResponse(BaseModel):
id: str
name: str
description: Optional[str]
category: Optional[str]
tags: list[str]
metadata: dict
created_by: str
created_at: str
updated_at: str
class HealthResponse(BaseModel):
status: str
service: str
version: str
timestamp: str
items_count: int