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

from ..core.pydantic_utilities import UniversalBaseModel
import pydantic
import typing
from .criticality_dto import CriticalityDto
from .composition_mode_dto import CompositionModeDto
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class Guideline(UniversalBaseModel):
    """
    Represents a guideline.
    """

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

    condition: str = pydantic.Field()
    """
    If this condition is satisfied, the action will be performed
    """

    action: typing.Optional[str] = pydantic.Field(default=None)
    """
    This action will be performed if the condition is satisfied
    """

    description: typing.Optional[str] = pydantic.Field(default=None)
    """
    Optional description providing additional context for the guideline
    """

    criticality: typing.Optional[CriticalityDto] = pydantic.Field(default=None)
    """
    The criticality level of the guideline
    """

    enabled: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether the guideline is enabled
    """

    tags: typing.List[str] = pydantic.Field()
    """
    The tags associated with the guideline
    """

    metadata: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field()
    """
    Metadata for the guideline
    """

    composition_mode: typing.Optional[CompositionModeDto] = None

    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
