File size: 567 Bytes
fba6023
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from __future__ import annotations

from typing import Any

from pydantic import BaseModel, ConfigDict, Field


class ErrorBody(BaseModel):
    code: str
    message: str
    details: Any | None = None


class ErrorResponse(BaseModel):
    success: bool = False
    request_id: str
    error: ErrorBody


class SuccessResponse(BaseModel):
    model_config = ConfigDict(extra="forbid")

    success: bool = True
    request_id: str
    processing_time: float = Field(ge=0)
    download_url: str | None = None
    metadata: dict[str, Any] = Field(default_factory=dict)