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

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class CommentRequest(UncheckedBaseModel):
    """
    Comment Serializer with FSM state support.

    Note: The 'state' field will be populated from the queryset annotation
    if present, preventing N+1 queries. Use .with_state() on your queryset.

    The state field display is controlled by both:
    - fflag_feat_fit_568_finite_state_management (FSM background calculations)
    - fflag_feat_fit_710_fsm_state_fields (state field display in APIs)
    """

    annotation: typing.Optional[int] = None
    classifications: typing.Optional[typing.Optional[typing.Any]] = pydantic.Field(default=None)
    """
    Classifications applied by a reviewer or annotator
    """

    draft: typing.Optional[int] = None
    is_resolved: typing.Optional[bool] = pydantic.Field(default=None)
    """
    True if the comment is resolved
    """

    region_ref: typing.Optional[typing.Optional[typing.Any]] = pydantic.Field(default=None)
    """
    Set if this comment is related to a specific part of the annotation. Normally contains region ID and control name.
    """

    text: typing.Optional[str] = pydantic.Field(default=None)
    """
    Reviewer or annotator comment
    """

    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
