FastApi-ISS/schemas.py
2025-09-25 03:08:47 +03:30

21 lines
648 B
Python

from pydantic import BaseModel, Field
from typing import List, Optional
from uuid import UUID
from datetime import datetime
class ScrapeRequest(BaseModel):
username: str
seller_id: UUID
# existing field
max_count: int = Field(default=5, ge=1, le=50)
# NEW: accept "count" from older/other callers; ignored if not present
count: Optional[int] = Field(default=None, ge=1, le=50)
class ScrapedPost(BaseModel):
ig_post_id: str
media_type: str # "image", "video", or "carousel"
caption: Optional[str]
thumbnail_url: Optional[str]
local_media: List[str] # ✅ list of S3 URLs only
created_at: datetime