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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .budget_rule import BudgetRule


class BudgetConfig(UniversalBaseModel):
    """
    Budget Configuration
    """

    name: str = pydantic.Field()
    """
    Name of the budget configuration
    """

    type: typing.Literal["gateway-budget-config"] = pydantic.Field(default="gateway-budget-config")
    """
    +value=gateway-budget-config
    +sort=2
    """

    rules: typing.List[BudgetRule] = pydantic.Field()
    """
    List of budget rules
    """

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

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