Initial commit
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import date
|
||||
|
||||
from pydantic import BaseModel, Field, field_validator
|
||||
|
||||
|
||||
class ProcessNowRequest(BaseModel):
|
||||
inbox_id: str
|
||||
mode: str = Field(pattern="^(new|backlog)$")
|
||||
limit: int | None = None
|
||||
|
||||
|
||||
class BacklogRequest(BaseModel):
|
||||
inbox_id: str
|
||||
folder: str | None = None
|
||||
since: date | None = None
|
||||
before: date | None = None
|
||||
limit: int | None = 200
|
||||
dry_run: bool = False
|
||||
reprocess: bool = False
|
||||
mark_seen: bool = False
|
||||
|
||||
@field_validator("since", "before", mode="before")
|
||||
@classmethod
|
||||
def empty_date_is_missing(cls, value):
|
||||
return None if value == "" else value
|
||||
Reference in New Issue
Block a user