"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from .toolcallstatus import ToolCallStatus
from openrouter.types import BaseModel, UnrecognizedStr
from openrouter.utils import validate_open_enum
import pydantic
from pydantic.functional_validators import PlainValidator
from typing import Literal, Optional, Union
from typing_extensions import Annotated, NotRequired, TypedDict


Command = Union[
    Literal[
        "view",
        "create",
        "str_replace",
        "insert",
    ],
    UnrecognizedStr,
]


OutputTextEditorServerToolItemType = Literal["openrouter:text_editor",]


class OutputTextEditorServerToolItemTypedDict(TypedDict):
    r"""An openrouter:text_editor server tool output item"""

    status: ToolCallStatus
    type: OutputTextEditorServerToolItemType
    command: NotRequired[Command]
    file_path: NotRequired[str]
    id: NotRequired[str]


class OutputTextEditorServerToolItem(BaseModel):
    r"""An openrouter:text_editor server tool output item"""

    status: Annotated[ToolCallStatus, PlainValidator(validate_open_enum(False))]

    type: OutputTextEditorServerToolItemType

    command: Annotated[Optional[Command], PlainValidator(validate_open_enum(False))] = (
        None
    )

    file_path: Annotated[Optional[str], pydantic.Field(alias="filePath")] = None

    id: Optional[str] = None
