solution
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
"""Сообщение брокера: только идентификаторы и служебные поля контракта v1."""
|
||||
|
||||
from typing import Literal
|
||||
from uuid import UUID
|
||||
|
||||
from pydantic import AwareDatetime, BaseModel, ConfigDict, Field
|
||||
|
||||
|
||||
class JobMessage(BaseModel):
|
||||
model_config = ConfigDict(extra="forbid")
|
||||
|
||||
schema_version: Literal[1] = 1
|
||||
type: Literal["attachment.process.v1"] = "attachment.process.v1"
|
||||
job_id: UUID
|
||||
attachment_id: UUID
|
||||
pipeline_version: int = Field(default=1, ge=1)
|
||||
attempt: int = Field(ge=1)
|
||||
created_at: AwareDatetime
|
||||
traceparent: str | None = Field(
|
||||
default=None, pattern=r"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$"
|
||||
)
|
||||
tracestate: str | None = Field(default=None, max_length=512)
|
||||
Reference in New Issue
Block a user