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

import datetime as dt
import typing

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


class SystemFolderResponse(UniversalBaseModel):
    """
    Response model for a task's system folder record.
    """

    archive_checksum: typing.Optional[str] = pydantic.Field(default=None)
    """
    SHA256 checksum of the archive. NULL means never synced.
    """

    archive_size_bytes: typing.Optional[int] = pydantic.Field(default=None)
    """
    Size of the archive in bytes after last sync.
    """

    created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    The timestamp when this record was created.
    """

    folder_type: str = pydantic.Field()
    """
    The type of system folder (e.g., 'dot_claude').
    """

    id: str = pydantic.Field()
    """
    The unique identifier of this record.
    """

    last_synced_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Timestamp of the last successful sync operation.
    """

    sync_status: typing.Optional[str] = pydantic.Field(default=None)
    """
    Current sync status: PENDING, SYNCING, SUCCESS, or FAILED.
    """

    task_id: str = pydantic.Field()
    """
    The task this system folder belongs to.
    """

    updated_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    The timestamp when this record was last updated.
    """

    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
