File size: 589 Bytes
a240da9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import datetime as dt
import enum

from pydantic import BaseModel


class RequestInput(BaseModel):
    author: str
    content: str


class EntriesResult(BaseModel):
    id: str
    author: str
    summary: str
    tags: list[str]
    date: dt.datetime


class JobInput(BaseModel):
    id: str
    author: str
    content: str


class JobStatus(str, enum.Enum):
    pending = "pending"
    done = "done"
    failed = "failed"
    cancelled = "cancelled"
    not_found = "not found"


class JobStatusResult(BaseModel):
    id: str
    status: JobStatus
    last_updated: dt.datetime | None