mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-24 21:38:09 +02:00
27 lines
581 B
Python
27 lines
581 B
Python
from datetime import datetime
|
|
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
|
|
class PATCreate(BaseModel):
|
|
label: str = Field(min_length=1, max_length=120)
|
|
expires_in_days: int | None = Field(default=None, gt=0)
|
|
|
|
|
|
class PATCreated(BaseModel):
|
|
id: int
|
|
label: str
|
|
token: str
|
|
prefix: str
|
|
expires_at: datetime | None = None
|
|
|
|
|
|
class PATRead(BaseModel):
|
|
id: int
|
|
label: str
|
|
prefix: str
|
|
expires_at: datetime | None = None
|
|
last_used_at: datetime | None = None
|
|
created_at: datetime
|
|
|
|
model_config = ConfigDict(from_attributes=True)
|