27 lines
1.1 KiB
Python
27 lines
1.1 KiB
Python
from pydantic import BaseModel, Field
|
|
from typing import Optional
|
|
from datetime import datetime
|
|
import uuid
|
|
|
|
class RoutingAPIBase(BaseModel):
|
|
name: str = Field(..., description="Name of the routing API")
|
|
description: Optional[str] = Field(None, description="Description of the routing API")
|
|
api_key: str = Field(..., description="API key for the routing API")
|
|
max_requests: int = Field(..., description="Maximum number of requests allowed for the routing API")
|
|
|
|
class RoutingAPICreate(RoutingAPIBase):
|
|
pass
|
|
|
|
class RoutingAPIUpdate(RoutingAPIBase):
|
|
name: Optional[str] = Field(None, description="Name of the routing API")
|
|
description: Optional[str] = Field(None, description="Description of the routing API")
|
|
api_key: Optional[str] = Field(None, description="API key for the routing API")
|
|
max_requests: Optional[int] = Field(None, description="Maximum number of requests allowed for the routing API")
|
|
|
|
class RoutingAPISchema(RoutingAPIBase):
|
|
id: uuid.UUID
|
|
created_at: datetime
|
|
updated_at: datetime
|
|
|
|
class Config:
|
|
orm_mode = True |