Command to Unity
| 171 | |
| 172 | |
| 173 | class CommandMessage(Message): |
| 174 | """Command to Unity""" |
| 175 | |
| 176 | model_config = ConfigDict(frozen=True) |
| 177 | |
| 178 | type: Literal["COMMAND"] = "COMMAND" |
| 179 | id: str = "" |
| 180 | command: str = "" |
| 181 | params: dict[str, Any] = Field(default_factory=dict) |
| 182 | timeout_ms: int = Field(default=30000, gt=0) |
| 183 | |
| 184 | @field_validator("command") |
| 185 | @classmethod |
| 186 | def validate_command(cls, v: str) -> str: |
| 187 | if not v: |
| 188 | raise ValueError("command must not be empty") |
| 189 | return v |
| 190 | |
| 191 | |
| 192 | # CLI -> Relay Messages |
no outgoing calls