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

import typing

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


class SyncResponse(UniversalBaseModel):
    """
    Response for sync operations.
    """

    status: SyncResponseStatus = pydantic.Field()
    """
    Overall sync status
    """

    sync_id: str = pydantic.Field()
    """
    Unique sync identifier
    """

    processed: int = pydantic.Field()
    """
    Total operations processed
    """

    results: typing.Dict[str, int] = pydantic.Field()
    """
    Results breakdown by operation type
    """

    by_namespace: typing.Dict[str, typing.Dict[str, int]] = pydantic.Field()
    """
    Results grouped by namespace
    """

    processing_time_ms: int = pydantic.Field()
    """
    Processing time in milliseconds
    """

    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
