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

import datetime as dt
import typing

import pydantic
import typing_extensions
from ...core.pydantic_utilities import IS_PYDANTIC_V2
from ...core.serialization import FieldMetadata
from ...core.unchecked_base_model import UncheckedBaseModel


class KnowledgeBase(UncheckedBaseModel):
    id: typing_extensions.Annotated[
        str,
        FieldMetadata(alias="_id"),
        pydantic.Field(alias="_id", description="The unique identifier for the knowledge base"),
    ]
    name: str = pydantic.Field()
    """
    The name of the knowledge base
    """

    description: typing.Optional[str] = pydantic.Field(default=None)
    """
    The description of the knowledge base
    """

    organization: str = pydantic.Field()
    """
    The organization ID
    """

    created_by: typing_extensions.Annotated[
        str,
        FieldMetadata(alias="createdBy"),
        pydantic.Field(alias="createdBy", description="The user ID who created the knowledge base"),
    ]
    created_at: typing_extensions.Annotated[
        typing.Optional[dt.datetime],
        FieldMetadata(alias="createdAt"),
        pydantic.Field(alias="createdAt", description="The date and time when the knowledge base was created"),
    ] = None
    updated_at: typing_extensions.Annotated[
        typing.Optional[dt.datetime],
        FieldMetadata(alias="updatedAt"),
        pydantic.Field(alias="updatedAt", description="The date and time when the knowledge base was last updated"),
    ] = None

    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
