from __future__ import annotations from pydantic import BaseModel, Field class SoftwareAOperator(BaseModel): user_id: str user_name: str class DeployOptions(BaseModel): graceful: bool = True class CreateDeployTaskRequest(BaseModel): operator: SoftwareAOperator tenant_id: str app_code: str env: str version: str target_nodes: list[str] = Field(default_factory=list) deploy_options: DeployOptions = Field(default_factory=DeployOptions) class CreateDeployTaskData(BaseModel): software_a_task_id: str task_status: str class DeployTaskDetailData(BaseModel): software_a_task_id: str task_status: str progress_percent: int app_code: str env: str version: str target_nodes: list[str] started_at: str finished_at: str | None = None error_detail: str | None = None class PermissionCheckRequest(BaseModel): operator: SoftwareAOperator action_type: str app_code: str env: str class PermissionCheckData(BaseModel): allowed: bool reason: str