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

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .function_config_response_body_params import FunctionConfigResponseBodyParams
from .function_config_response_body_secrets import FunctionConfigResponseBodySecrets
from .function_schedule_response_body import FunctionScheduleResponseBody


class FunctionConfigResponseBody(UniversalBaseModel):
    """
    Configuration of the Function.
    """

    handler: str = pydantic.Field()
    """
    The handler entrypoint for the function code.
    """

    is_schedule_enabled: typing_extensions.Annotated[
        bool,
        FieldMetadata(alias="isScheduleEnabled"),
        pydantic.Field(alias="isScheduleEnabled", description="Whether the run schedule is enabled."),
    ]
    params: FunctionConfigResponseBodyParams = pydantic.Field()
    """
    Default parameters for the function.
    """

    schedule: typing.Optional[FunctionScheduleResponseBody] = None
    secrets: FunctionConfigResponseBodySecrets = pydantic.Field()
    """
    Secret names available to the function. Values are always empty.
    """

    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
