from pydantic import BaseModel, EmailStr
from datetime import datetime
from typing import Optional

class SmtpBase(BaseModel):
    hostname: str
    port: int
    sender_email_address: EmailStr
    username:str
    password: str
    encryption_method: str
class SmtpResponse(SmtpBase):
    id: int

    class Config:
        from_attributes = True  # Pour convertir SQLAlchemy en Pydantic
class SmtpCreate(SmtpBase):
    pass

class SmtpUpdate(SmtpBase):
    pass  # Utilisé pour la mise à jour

class SmtpOut(SmtpBase):
    id: int

class Config:
        from_attributes = True
