from datetime import datetime
from typing import Optional

from pydantic import BaseModel


class SMessage(BaseModel):
    message: str
    image_url: Optional[str] = None
    chat_id: int
    user_id: int
    created_at: datetime
    avatar_image: str

    class Config:
        from_attributes = True


class SLastMessages:
    def __init__(
            self,
            messages_count: int,
            messages_to_get: int,
    ):
        self.messages_count = messages_count
        self.messages_to_get = messages_to_get
