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

import typing

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


class DataAccessRuleBase(UniversalBaseModel):
    """
    Data Access Rule
    """

    id: str = pydantic.Field()
    """
    Unique identifier for the rule
    """

    description: typing.Optional[str] = pydantic.Field(default=None)
    """
    Description of the rule
    """

    subjects: typing.List[str] = pydantic.Field()
    """
    List of subjects that this rule applies to (users, teams, roles)
    """

    enabled: typing.Optional[bool] = pydantic.Field(default=True)
    """
    Whether this rule is enabled
    """

    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
