# Generated by ariadne-codegen
# Source: ../../schema.graphql

from typing import Any, Optional
from uuid import UUID

from pydantic import Field

from .base_model import BaseModel
from .enums import (
    AgentSubtype,
    ChatMode,
    ModelName,
    ReasoningLevel,
    SandboxProvider,
    ToolPermissionStatus,
)


class AcceptPlanInput(BaseModel):
    tool_use_id: str = Field(alias="toolUseId")
    clear_context: bool = Field(alias="clearContext")


class AskUserQuestionAnswerInput(BaseModel):
    question: str
    selected_options: list[str] = Field(alias="selectedOptions")
    custom_answer: Optional[str] = Field(alias="customAnswer", default=None)


class AskUserQuestionInput(BaseModel):
    answers: list["AskUserQuestionAnswerInput"]
    skip: bool = False
    tool_use_id: Optional[str] = Field(alias="toolUseId", default=None)


class AttachmentInput(BaseModel):
    file_attachment: Optional["FileAttachmentInput"] = Field(
        alias="fileAttachment", default=None
    )
    url_attachment: Optional["URLAttachmentInput"] = Field(
        alias="urlAttachment", default=None
    )
    table_schema_attachment: Optional["TableSchemaAttachmentInput"] = Field(
        alias="tableSchemaAttachment", default=None
    )
    prompt_attachment: Optional["PromptAttachmentInput"] = Field(
        alias="promptAttachment", default=None
    )
    sql_attachment: Optional["SQLAttachmentInput"] = Field(
        alias="sqlAttachment", default=None
    )
    skill_attachment: Optional["SkillAttachmentInput"] = Field(
        alias="skillAttachment", default=None
    )


class ChatConfigInput(BaseModel):
    chat_uuid: UUID = Field(alias="chatUuid")
    model: Optional[ModelName] = None
    require_confirmation: Optional[bool] = Field(
        alias="requireConfirmation", default=False
    )
    depth_limit: int = Field(alias="depthLimit", default=6)
    reasoning_level: Optional[ReasoningLevel] = Field(
        alias="reasoningLevel", default=None
    )
    internal_settings: Optional[Any] = Field(alias="internalSettings", default=None)


class ChatInput(BaseModel):
    prompt_input: Optional["PromptInput"] = Field(alias="promptInput", default=None)
    client_sourced_event_uuid: Optional[UUID] = Field(
        alias="clientSourcedEventUuid", default=None
    )
    permission_response: Optional["PermissionResponseInput"] = Field(
        alias="permissionResponse", default=None
    )
    accept_plan_input: Optional["AcceptPlanInput"] = Field(
        alias="acceptPlanInput", default=None
    )
    enter_plan_mode: Optional[bool] = Field(alias="enterPlanMode", default=None)
    exit_plan_mode_without_plan: Optional[bool] = Field(
        alias="exitPlanModeWithoutPlan", default=None
    )
    environment_variable_response: Optional["EnvironmentVariableResponseInput"] = Field(
        alias="environmentVariableResponse", default=None
    )
    ask_user_question: Optional["AskUserQuestionInput"] = Field(
        alias="askUserQuestion", default=None
    )
    timezone: Optional[str] = None
    mcp_server_configs: Optional["McpServerConfigsInput"] = Field(
        alias="mcpServerConfigs", default=None
    )
    database_resource_configs: Optional[list["DatabaseResourceConfigInput"]] = Field(
        alias="databaseResourceConfigs", default=None
    )
    repository_resource_configs: Optional[list["RepositoryResourceConfigInput"]] = (
        Field(alias="repositoryResourceConfigs", default=None)
    )
    include_datadog_tools: Optional[bool] = Field(
        alias="includeDatadogTools", default=None
    )
    include_sentry_tools: Optional[bool] = Field(
        alias="includeSentryTools", default=None
    )
    include_aws_tools: Optional[bool] = Field(alias="includeAwsTools", default=None)
    enabled_skill_ids: Optional[list[str]] = Field(
        alias="enabledSkillIds", default=None
    )


class ChatResourceConfigInput(BaseModel):
    mode: ChatMode
    primary_repository: Optional["RepositoryResourceConfigInput"] = Field(
        alias="primaryRepository", default=None
    )
    additional_repositories: Optional[list["RepositoryResourceConfigInput"]] = Field(
        alias="additionalRepositories", default=None
    )
    database: Optional["DatabaseResourceConfigInput"] = None
    mcp_server_configs: Optional["McpServerConfigsInput"] = Field(
        alias="mcpServerConfigs", default=None
    )
    skill_configs: Optional["SkillConfigsInput"] = Field(
        alias="skillConfigs", default=None
    )
    sandbox_provider: Optional[SandboxProvider] = Field(
        alias="sandboxProvider", default=None
    )
    cloud_agent_subtype: Optional[AgentSubtype] = Field(
        alias="cloudAgentSubtype", default=None
    )


class DatabaseResourceConfigInput(BaseModel):
    database_config_uuid: UUID = Field(alias="databaseConfigUuid")


class EnvironmentVariableResponseEntry(BaseModel):
    key: str
    value: str


class EnvironmentVariableResponseInput(BaseModel):
    variables: list["EnvironmentVariableResponseEntry"]
    tool_use_id: str = Field(alias="toolUseId")
    skipped_keys: list[str] = Field(alias="skippedKeys", default_factory=lambda: [])


class FileAttachmentInput(BaseModel):
    file: "FileInput"
    content: str


class FileInput(BaseModel):
    file_path: str = Field(alias="filePath")
    working_directory: str = Field(alias="workingDirectory")


class McpServerConfigInput(BaseModel):
    server_name: str = Field(alias="serverName")
    enabled_tools: list[str] = Field(alias="enabledTools")


class McpServerConfigsInput(BaseModel):
    all_servers: Optional[bool] = Field(alias="allServers", default=None)
    server_configs: Optional[list["McpServerConfigInput"]] = Field(
        alias="serverConfigs", default=None
    )


class PermissionResponseInput(BaseModel):
    permission_status: ToolPermissionStatus = Field(alias="permissionStatus")
    tool_use_id: str = Field(alias="toolUseId")


class PromptAttachmentInput(BaseModel):
    prompt_name: str = Field(alias="promptName")
    prompt_content: str = Field(alias="promptContent")


class PromptInput(BaseModel):
    message: str
    attachments: list["AttachmentInput"]


class RepositoryResourceConfigInput(BaseModel):
    repository_uuid: UUID = Field(alias="repositoryUuid")


class SQLAttachmentInput(BaseModel):
    query_content: str = Field(alias="queryContent")


class SkillAttachmentInput(BaseModel):
    skill_name: str = Field(alias="skillName")


class SkillConfigInput(BaseModel):
    skill_id: str = Field(alias="skillId")


class SkillConfigsInput(BaseModel):
    skill_configs: list["SkillConfigInput"] = Field(alias="skillConfigs")


class TableSchemaAttachmentInput(BaseModel):
    table_name: str = Field(alias="tableName")
    table_schema: Any = Field(alias="tableSchema")


class URLAttachmentInput(BaseModel):
    url: str
    content: str


AskUserQuestionInput.model_rebuild()
AttachmentInput.model_rebuild()
ChatInput.model_rebuild()
ChatResourceConfigInput.model_rebuild()
EnvironmentVariableResponseInput.model_rebuild()
FileAttachmentInput.model_rebuild()
McpServerConfigsInput.model_rebuild()
PromptInput.model_rebuild()
SkillConfigsInput.model_rebuild()
