# 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 KnowledgeSliceResponse(UniversalBaseModel):
    """
    Schema for knowledge slice response.
    """

    id: str = pydantic.Field()
    """
    Unique identifier for the knowledge slice
    """

    name: str = pydantic.Field()
    """
    Display name of the knowledge slice
    """

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

    type: str = pydantic.Field()
    """
    Slice type: 'standard', 'personal', or 'chat_space'
    """

    is_composite: bool = pydantic.Field()
    """
    Whether this slice is a composite of other slices
    """

    owner_type: str = pydantic.Field()
    """
    Owner entity type: 'organization', 'department', or 'user'
    """

    owner_id: str = pydantic.Field()
    """
    ID of the owning entity
    """

    status: str = pydantic.Field()
    """
    Current status of the slice (e.g. 'active', 'archived')
    """

    member_slice_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    IDs of member slices if this is a composite slice
    """

    store_count: int = pydantic.Field()
    """
    Number of vector stores associated with this slice
    """

    organization_id: str = pydantic.Field()
    """
    ID of the organization this slice belongs to
    """

    created_by: typing.Optional[str] = pydantic.Field(default=None)
    """
    ID of the user who created this slice
    """

    created_at: dt.datetime = pydantic.Field()
    """
    Timestamp when the slice was created
    """

    updated_at: dt.datetime = pydantic.Field()
    """
    Timestamp when the slice was last updated
    """

    archived_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Timestamp when the slice was archived, if applicable
    """

    archived_by: typing.Optional[str] = pydantic.Field(default=None)
    """
    ID of the user who archived this slice, if applicable
    """

    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
