| 1 | from typing import Any |
| 2 | from typing import Dict |
| 3 | from typing import List |
| 4 | from typing import Optional |
| 5 | |
| 6 | from pydantic import BaseModel |
| 7 | from pydantic import ConfigDict |
| 8 | from pydantic import Field |
| 9 | |
| 10 | |
| 11 | class Configuration(BaseModel): |
| 12 | api_url: Optional[str] = Field(None, alias="@value") |
| 13 | http_connect_timeout: Optional[int] = Field(None, alias="@value") |
| 14 | http_read_timeout: Optional[int] = Field(None, alias="@value") |
| 15 | http_user_agent: Optional[str] = Field(None, alias="@value") |
| 16 | http_write_timeout: Optional[int] = Field(None, alias="@value") |
| 17 | indicator: Optional[str] = Field(None, alias="@value") |
| 18 | type: Optional[str] = Field(None, alias="@value") |
| 19 | model_config = ConfigDict(extra="allow") |
| 20 | |
| 21 | |
| 22 | class Data(BaseModel): |
| 23 | # configuration: Optional[Configuration] |
| 24 | description: Optional[str] = Field(None, alias="@value") |
| 25 | name: Optional[str] = Field(None, alias="@value") |
| 26 | title: Optional[str] = Field(None, alias="@value") |
| 27 | model_config = ConfigDict(extra="allow") |
| 28 | |
| 29 | |
| 30 | class Type(BaseModel): |
| 31 | name: str |
| 32 | version: str |
| 33 | model_config = ConfigDict(extra="allow") |
| 34 | |
| 35 | |
| 36 | class Constraint(BaseModel): |
| 37 | type: str |
| 38 | version: str |
| 39 | model_config = ConfigDict(extra="allow") |
| 40 | |
| 41 | |
| 42 | class Entity(BaseModel): |
| 43 | id: str |
| 44 | type: Type |
| 45 | v: str |
| 46 | data: Data |
| 47 | constraints: List[Constraint] |
| 48 | model_config = ConfigDict(extra="allow") |
| 49 | |
| 50 | |
| 51 | class ContentPack(BaseModel): |
| 52 | id: str |
| 53 | rev: int |
| 54 | v: str |
| 55 | name: str |
| 56 | summary: str |
| 57 | description: str |
| 58 | vendor: str |
| 59 | url: str |
| 60 | created_at: str |
| 61 | server_version: str |
| 62 | parameters: List |
| 63 | entities: List[Entity] |
| 64 | model_config = ConfigDict(extra="allow") |
| 65 | |
| 66 | |
| 67 | class ContentPackList(BaseModel): |
| 68 | total: int |
| 69 | content_packs: List[ContentPack] |
| 70 | content_packs_metadata: Optional[Dict[str, Any]] = None |
| 71 | model_config = ConfigDict(extra="allow") |