# This file was auto-generated by Fern from our API Definition.

from ..core.pydantic_utilities import UniversalBaseModel
import typing
import pydantic
from .structure_function_call_arguments_value import StructureFunctionCallArgumentsValue
from .structure_function_call_expected_result import StructureFunctionCallExpectedResult
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class StructureFunctionCall(UniversalBaseModel):
    """
    The model describing a function call.
    The validation is such that an instance contains a function name and a set of arguments that are valid to instantiate a function and a satisfiability check from the available functions.
    The resulting function and satisfiability check can always be called on any Netlist.
    """

    type: typing.Optional[typing.Literal["STRUCTURE_FUNCTION_CALL"]] = None
    function_name: str = pydantic.Field()
    """
    The name of the function that is called.
    """

    arguments: typing.Dict[str, StructureFunctionCallArgumentsValue] = pydantic.Field()
    """
    The arguments of the function that is called.
    """

    expected_result: StructureFunctionCallExpectedResult = pydantic.Field()
    """
    The expected result of calling the function with the given arguments on a PIC model.
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
