51 lines
1.2 KiB
Python
51 lines
1.2 KiB
Python
from __future__ import annotations
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class MetadataTreeNodeResponse(BaseModel):
|
|
id: str
|
|
label: str
|
|
kind: str
|
|
icon: str
|
|
qualified_name: str | None = None
|
|
count: int = 0
|
|
loaded_count: int = 0
|
|
has_more: bool = False
|
|
children: list["MetadataTreeNodeResponse"] = Field(default_factory=list)
|
|
|
|
|
|
class ProjectMetadataTreeResponse(BaseModel):
|
|
project_id: str
|
|
root: MetadataTreeNodeResponse
|
|
|
|
|
|
class MetadataTreeChildrenResponse(BaseModel):
|
|
project_id: str
|
|
parent_id: str
|
|
offset: int = 0
|
|
limit: int = 50
|
|
total: int = 0
|
|
has_more: bool = False
|
|
children: list[MetadataTreeNodeResponse] = Field(default_factory=list)
|
|
|
|
|
|
class MetadataTreeSearchResponse(BaseModel):
|
|
project_id: str
|
|
q: str
|
|
total: int = 0
|
|
results: list[MetadataTreeNodeResponse] = Field(default_factory=list)
|
|
|
|
|
|
class MetadataTreePathStepResponse(BaseModel):
|
|
parent_id: str
|
|
child_id: str
|
|
offset: int = 0
|
|
|
|
|
|
class MetadataTreePathResponse(BaseModel):
|
|
project_id: str
|
|
node_id: str
|
|
path: list[str] = Field(default_factory=list)
|
|
steps: list[MetadataTreePathStepResponse] = Field(default_factory=list)
|