47 lines
1.5 KiB
Python
47 lines
1.5 KiB
Python
from datetime import datetime
|
|
|
|
from models.service import ServiceEndpointDocument
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
|
|
class ProxyDocument(BaseModel):
|
|
model_config = ConfigDict(extra="forbid")
|
|
|
|
proxy_port: int = Field(..., description="Port exposed by the proxy")
|
|
name: str = Field(..., description="Human readable proxy name")
|
|
code: str = Field(..., description="Proxy source or identifier")
|
|
service: ServiceEndpointDocument = Field(
|
|
...,
|
|
description="Associated upstream service",
|
|
)
|
|
created_at: datetime | None = Field(
|
|
default=None,
|
|
description="Creation timestamp in UTC",
|
|
)
|
|
updated_at: datetime | None = Field(
|
|
default=None,
|
|
description="Last update timestamp in UTC",
|
|
)
|
|
|
|
|
|
class ProxyCreateInput(BaseModel):
|
|
model_config = ConfigDict(extra="forbid")
|
|
|
|
proxy_port: int = Field(..., description="Port exposed by the proxy")
|
|
name: str = Field(..., description="Human readable proxy name")
|
|
code: str = Field(..., description="Proxy source or identifier")
|
|
service: ServiceEndpointDocument = Field(
|
|
...,
|
|
description="Associated upstream service",
|
|
)
|
|
|
|
|
|
class ProxyUpdateInput(BaseModel):
|
|
model_config = ConfigDict(extra="forbid")
|
|
|
|
name: str | None = Field(default=None, description="Human readable proxy name")
|
|
code: str | None = Field(default=None, description="Proxy source or identifier")
|
|
service: ServiceEndpointDocument | None = Field(
|
|
default=None,
|
|
description="Associated upstream service",
|
|
) |