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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from .load_balancing_when import LoadBalancingWhen
from .priority_based_load_balancing import PriorityBasedLoadBalancing


class PriorityBasedLoadBalancingRule(PriorityBasedLoadBalancing):
    """
    +label=Priority-based Load Balancing Rule
    """

    id: str = pydantic.Field()
    """
    +usage=Unique identifier for the rule
    +uiProps={"descriptionInline":true}
    +sort=2
    +label=Rule ID
    """

    when: LoadBalancingWhen

    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
