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

from __future__ import annotations
from .custom_output import CustomOutput, CustomOutputTypedDict
from opperai.types import BaseModel
from opperai.utils import validate_const
import pydantic
from pydantic import ConfigDict
from pydantic.functional_validators import AfterValidator
from typing import Any, Dict, Literal
from typing_extensions import Annotated, TypedDict


class ChatCompletionMessageCustomToolCallTypedDict(TypedDict):
    id: str
    custom: CustomOutputTypedDict
    type: Literal["custom"]


class ChatCompletionMessageCustomToolCall(BaseModel):
    model_config = ConfigDict(
        populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
    )
    __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)

    id: str

    custom: CustomOutput

    TYPE: Annotated[
        Annotated[Literal["custom"], AfterValidator(validate_const("custom"))],
        pydantic.Field(alias="type"),
    ] = "custom"

    @property
    def additional_properties(self):
        return self.__pydantic_extra__

    @additional_properties.setter
    def additional_properties(self, value):
        self.__pydantic_extra__ = value  # pyright: ignore[reportIncompatibleVariableOverride]
