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

import datetime as dt
import typing

import pydantic
from ..core.pydantic_utilities import UniversalBaseModel
from .anchor import Anchor
from .comment_attachment import CommentAttachment
from .link import Link
from .mention import Mention
from .text_review_annotation import TextReviewAnnotation
from .time_stamp import TimeStamp


class Comment(UniversalBaseModel):
    anchor: typing.Optional[Anchor] = pydantic.Field(default=None)
    """
    Comment anchor location. {(x, y) | 0 <= x <= 1, 0 <= y <= 1}.
    """

    annotation: typing.Optional[str] = None
    attachments: typing.Optional[typing.List[CommentAttachment]] = pydantic.Field(default=None)
    """
    Attachments associated with this comment (0-6 attachments allowed)
    """

    completed_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Completion timestamp
    """

    completer_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    ID of user who marked the comment as completed
    """

    created_at: dt.datetime = pydantic.Field()
    """
    Creation timestamp
    """

    duration: typing.Optional[int] = pydantic.Field(default=None)
    """
    Duration of comment in frames. Requires presence of timestamp parameter
    """

    file_id: str = pydantic.Field()
    """
    File ID
    """

    id: str = pydantic.Field()
    """
    Comment ID
    """

    links: typing.List[Link] = pydantic.Field()
    """
    Links
    """

    mentions: typing.List[Mention] = pydantic.Field()
    """
    Mentions
    """

    page: typing.Optional[int] = pydantic.Field(default=None)
    """
    Document page
    """

    text: str = pydantic.Field()
    """
    Comment text
    """

    text_edited_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Text edited timestamp
    """

    text_review_annotation: typing.Optional[TextReviewAnnotation] = pydantic.Field(default=None)
    """
    Text review annotation details for comments left on text documents.
    """

    timestamp: TimeStamp
    updated_at: dt.datetime = pydantic.Field()
    """
    Update timestamp
    """

    model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)
