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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .crawl_status import CrawlStatus
from .external_sync_job_trigger import ExternalSyncJobTrigger
from .external_sync_job_type import ExternalSyncJobType
from .external_sync_provider import ExternalSyncProvider


class KbExternalSyncJob(UncheckedBaseModel):
    type: ExternalSyncProvider = "google_drive"
    folder_id: str
    integration_connection_id: str
    triggered_by: ExternalSyncJobTrigger
    status: typing.Optional[CrawlStatus] = None
    sync_type: typing.Optional[ExternalSyncJobType] = None
    items_identified: typing.Optional[int] = None
    items_processed: typing.Optional[int] = None
    error_message: typing.Optional[str] = None
    started_at: typing.Optional[int] = None
    completed_at: typing.Optional[int] = None
    updated_at: int
    id: str
    created_at: int

    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
